Re: what is the meaining of this message?
i am using BufferedReader and PrintWriter how can i deal with this case?
you can prin it without problem but the problem when you try to read it:
this command returns just the first line of the file or object
where bfr is BefferedReader
Re: what is the meaining of this message?
You mean reading sockets?
wiring part is basically in no ways different. You have a chunk of data, you write to a stream, flush it to make sure all is there. And eventually at some point, close the stream.
Reading is much more tricky. There are suns tutorials on handlin sckets, that I advice you to read. Basically it boils down to a number of approaches... heres“s some.
Sockets are like keyboard input, as long as the socket is open, you cannot as such tell when the message has ended. Fact that there has been nothing coming in for "quite some while" does not necessarily mean, that all is here. So the question is, when to stop reading?
- have the server and clients agree on protocol to use.
This can be elaborate, and also as simple as each sending first data signifying the size of the actual message (in bytes). Then each end knows how much they should read to get the message. Protocol specs are solely down to the needs of your app.
- Do you need two ways communication? If not, close the socket when done with writing.
So, as such, not a sole can tell you how you should approach it in your application, at least based on that info. Try an approach or two and come back with issues relating to it.