How to use socket with a Python client and a C++ server
In C++ server, you accept
connection, read
, write
, then leak the open socket and go to wait for next client to connect.
Move your accept
out of the loop, or add inner loop after accept.
And close
the socket when you're done with it, before the variable with socket number goes out of scope.