Open b62303411 opened 8 years ago
Deleting the endpoint, creating a new one, and trying a different port is probably the safest. Its possible that simply calling listen again on the same endpoint with a different port will work. There is also an overload of listen that takes an error code output parameter if you find checking an error code simpler to handle than an exception.
What is the proper way to hanlde websocket server instance failure upon start
try websocketServer->listen("127.0.0.1", websocketServerPort); // WILL THROW AN EXCEPTION IF THE PORT IS NOT AVAILABLE // Start the server accept loop websocketServer->start_perpetual(); websocketServer->start_accept(); catch() ( underlying transport error) .. what to do.. ??
do i need to delete my end point ?, if the port is somehow hold by my previous instance that has not closed properly is there any way out of it ? logging an error doesnt help me leading the app to eventualy recover from an error that could be only temporary and rebooting my app every time the server part of it fail seems very bad practice.