readLine in a BufferedReader object

S

Sebastiano Gazzola

I'm trying to develop a simple echo server with java. I use a
BufferedReader to retrieve the characters in input from the socket, but
when I use System.out.print to print the String object that readLine
returns to me, there are a lot of strange chars before the real word
sent by the client. I think these chars specify the format of the data,
but how can I print the data I received without this addtional data I
don't need?

Many thanks

Sebastiano
 
G

Gordon Beaton

I'm trying to develop a simple echo server with java. I use a
BufferedReader to retrieve the characters in input from the socket,
but when I use System.out.print to print the String object that
readLine returns to me, there are a lot of strange chars before the
real word sent by the client. I think these chars specify the format
of the data, but how can I print the data I received without this
addtional data I don't need?

The only data received by the server is data actually sent by the
client. It could be that you are not using the same stream or reader
types at each end of the connection, or perhaps you have made a
mistake in your handling of the data (at one or the other end of the
connection).

If you didn't write the client, what client are you using to talk to
your server?

/gordon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,118
Latest member
LatishaWhy
Top