I am working on socket programming. Is there any way to detect the server disconnection to the client immediately.
I used socket.isConnected , isBound methods but I did’t get good results.
I tried to read the data from the stream continuously to check but it blocks that if data is not available or return from the server and I don’t want to write garbage data to send each time to check the connection with the server.
Please suggest any suggestions.