Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Reading bytes from TCP port

807607Dec 9 2006 — edited Dec 13 2006
Actually looking to read: client data(these are devices sending data to server socket, each device sends data on state of change) send to the server socket on TCP port 11111. This program is to run all times and say should pass the received string to a thread for processing. But while reading
is = socket.getInputStream() ;

while(true) {
System.out.println( "" + Integer.toHexString(is.read()));

This reads byte by byte. I am looking for a way to read data send by each device (may be 20-30 characters) at a go.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 10 2007
Added on Dec 9 2006
13 comments
371 views