What are the exact error messages from both TCP client and server (if client attempts to connect to the socket at all) sockets? They might provide some hints to understand at which point the connection fails - at listen, at accept or at send/receive.