java - How can i check if there is incoming data from a TCP Socket without receiving it? -


basically need notification, proceed receive data using class datainputstream , method read().

the problem datainputstream not have method check if there read , doing tests read() method interfere further calls read().

i can hack make test reading 1 byte , append further data it, see if there more elegant solution.

datainputstream not have method check if there read

yes does. missed available() method, doesn't return non-zero, depending on you're connected to.

have @ pushbackinputstream.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -