My application creates threads for file transfer on both the server and client sides. Right now I'm using delaying tactics (a simple for loop) on client side so that thread creation in client is done *after* the thread creation process in server.
The app works fine. But this is crude, if not ugly. I need to find a technical way so that the client thread is not started until it knows that server thread has been started.
I tried to use a send() from server to the client. The client's `recv()` must block for server's signal but apparently it doesn't. The message on the client console is about connection being refused by the server. Any hints, please? It won't block it the socket isn't connected.
以上就是How to synchronize between a thread on server and a thread on client side?的详细内容，更多请关注web前端其它相关文章！