Looking for answers? Westonci.ca is your go-to Q&A platform, offering quick, trustworthy responses from a community of experts. Join our platform to connect with experts ready to provide detailed answers to your questions in various areas. Join our Q&A platform to connect with experts dedicated to providing accurate answers to your questions in various fields.

When should you close the socket python tcp server client.

Sagot :

f socket refers to an open TCP connection, the connection is closed. If a stream socket is closed when there is input data queued, the TCP connection is reset rather than being cleanly closed. The descriptor of the socket to be closed

To close the socket you need to call shutdown() first and then close(), and shutdown takes an argument