I need a little help with implementation of reading a data from socket in my application.
I'm working on application which is listening for a data using Socket and parsing received data. The problem is that I need to connect to my device and start the socket so I can receive the data. I was using ServerSocket
which is blocking and waiting to stop the other socket, which is sending me the data, and parse the data after that. But I need to be able to read the stream before closing the server's socket.
So any idea how can I achieve this kind of implementation and which classes I have to use about that?