when i restart the tcp server, it is unable to connect (still the messages above), if restarting server whilst client is still running. however if i exit and restart client, it connects fine.
the first one is trying to send but it can’t because the server doesn’t exists anymore so it disconnects. the second is trying to create the connection to the the server but it can’t because there’s no server.
when i restart the tcp server, it is unable to connect (still the messages above), if restarting server whilst client is still running. however if i exit and restart client, it connects fine.
it could be that the server is not closing the port correctly when you exit or that the client doesn’t close the port correctly when it detects a disconnection, will look into it
i’m testing and the only problem i’ve seen is that the server is not removing the disconnected clients. i’ve fixed it but apart from that i can kill both the client and server and restart them and everything works without problem.
if the problem persists perhaps you can close the connections explicitly in the exit method of testApp, just in case your app is crashing on exist or something weird that makes the socket to not be closed properly
Hello, I think I am having a similar problem related to ofxTCPServer retaining disconnected clients. I’m using Windows 7, and openFrameworks v0.062. In oF I start up an instance of ofxTCPServer, then as soon as I connect to it with an external client, the console is immediately flooded with this message:
OF_ERROR: ofxNetwork:c:dev\of\addons\ofxnetwork\src\ofxtcpmanager.cpp: 304 unknown error: 0 see errno.h for description of the error
When I trace through, I see that the errno value is 10054 - meaning a fairly innocuous “An existing connection was forcibly closed by the remote host”
But I am still having the same problem. If I try to disconnect the clients manually, I frequently run into heap corruptions, because ofxTCPServer is not thread-safe (not even internally).
Functionally, communications seem to work, but I can’t use the console, even with verbose set to false everywhere. Any ideas on how I can fix this?
try using the addon from 007 on github, all those errors have been fixed there. from chris’ comments i think the only thing necessary to make it work is change ofThread with ofxThread
don’t use the individual repo for ofxNetwork but the one in the openFrameworks repository: