Explore Westonci.ca, the premier Q&A site that helps you find precise answers to your questions, no matter the topic. Connect with a community of professionals ready to provide precise solutions to your questions quickly and accurately. Get precise and detailed answers to your questions from a knowledgeable community of experts on our Q&A platform.

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