I am having java server and just one client at the time.
- client connects and sends card ID (blocking read on server side is suitable, because only 1 client at the time)
- if card doesn't exist in database it just sends back 0 and close the socket (no problem)
- if card does exist sends back 1
- now client has to send PIN to the server, but there has to be some timeout, let's say 10s. Here i cannot use blocking read, what should i do? Socket setSoTimeout is not an option, because first read is blocking but second one should not be.