My partner and I currently have a Python app that opens A TCP socket that communicates with another Python app on a separate host. Every once in a while, we notice the program either errors or we kill it. When that happens, the socket is still open for some time. Every time after we go to run the program, we get the following error:
socket.error: [Errno 98] Address already in use
Our program is using the same port, which means the socket is still open. But we checked and we're pretty sure it's not running in the background and our address is still in use.
Is there a way we can manually close the socket to we can reuse it?
Free Guide: Managing storage for virtual environments
Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!