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?
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.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.