Answer the question
In order to leave comments, you need to log in
Does Socket.Accept() freeze the program?
I'm trying to make a client-server in java via Socket, let's say there are two buttons in the frame, one starts the server, the second connects the client, I press the first one, on accept() the program freezes and starts waiting for the client (buttons do not press, keyEvent does not work), Accordingly, I can not connect the client, how to deal with this?
Answer the question
In order to leave comments, you need to log in
accept is a blocking call. Blocking calls must be performed in a separate thread.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question