You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm starting the server with a port of 0, so I can then immediately open a client of the server, without hard-wiring in a specific port. Before I start the client, I need to call getPort(). But that may not work, since the server field may not have been set yet, and that happens in a separate thread. My suggestion is to move the initial socket.bind to the start method, before the run method in the new thread. See included patch.
I no longer use Java-WebSocket (for Domterm I use libwebsockets instead).
However, I created a quick pull request #449 .
I tested that it still compiles, but I haven't otherwise tested it.
Glad to see Java-WebSocket is seeing some love again, even though I no longer use it myself.
I'm starting the server with a port of 0, so I can then immediately open a client of the server, without hard-wiring in a specific port. Before I start the client, I need to call getPort(). But that may not work, since the server field may not have been set yet, and that happens in a separate thread. My suggestion is to move the initial socket.bind to the start method, before the run method in the new thread. See included patch.
startserver-patch.txt
The text was updated successfully, but these errors were encountered: