hi all
i have had to implement a workaround for what i think is a bug in ofxTCPServer. i get the app running with a client no worries, but if the server app is quit and the client isn’t it needs to wait a while before the server can rebind the same port.
so I put a little loop in update to try to repeatedly check if it has to reconnect. but found that it could never recreate the server until I made the server object a pointer and deleted and created it before each attempt. now it does take a while before it can bind the port again but it does eventually work:
if (!TCP->isConnected() && ofGetElapsedTimeMillis() - last_connect > 5000) {
cout<<"Attempting to reconnect..."<<endl;
TCP->close();
delete TCP;
TCP = new ofxTCPServer();
TCP->setup(portIn);
last_connect = ofGetElapsedTimeMillis();
}
i think the prob may be in ofxTCPManager::Create()
cheers
nay