Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Socket Limits

Status
Not open for further replies.

denisc

Technical User
Jan 23, 2003
2
GB
Hello all,

i'm having problem in receiving messages with more than 2KB with sockets in Java. how can i get more than 2Kb of data from a socket without using readLine, and how can i detect the end of transmission?

Thanks in advance

DenisC

 
Hi,
Are you surely flushed OutputStreams? I not, that would be a probable reason for your problem.

I suppose you are using TCP sockets, if you don't use readLine, you can read incoming data e.g. into char-buffer by using BufferedReader or into byte-buffer by using BufferedInputStream.
Those read() -methods returns -1 when there is no more incoming data.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top