Hi,
The main thread of server sets the status to IDLE and then it starts another thread (child thread). Now the main thread is waiting for client connection (by calling Socket.accept()method ).
In the mean time, the child thread sets the server status to STOPPING due to the request it received.
Now the server main thread should not continue waiting for the client connection if the status had been set to STOPPING.
Is there any way to make the server thread to come out of the blocking state (i.e, it blocks until it accepts a connection and it should come out of it).
Is there any way for the server thread to check for the status while it is blocking for a client connection?
Thanks in advance...
The main thread of server sets the status to IDLE and then it starts another thread (child thread). Now the main thread is waiting for client connection (by calling Socket.accept()method ).
In the mean time, the child thread sets the server status to STOPPING due to the request it received.
Now the server main thread should not continue waiting for the client connection if the status had been set to STOPPING.
Is there any way to make the server thread to come out of the blocking state (i.e, it blocks until it accepts a connection and it should come out of it).
Is there any way for the server thread to check for the status while it is blocking for a client connection?
Thanks in advance...