Hi Yusrizal,
as far as I know (I've never used it yet) the method readLine() reads
data up to the next end-of-line character. So if you're dealing with
binary coded data you simply can't assume that any string will be
delimited by an end-of-line character (such as LF, 0x0a, on Unix and
CR/LF, 0x0d+0x0a, on Windows).
Stick to reading the data in binary mode, there's probably no other
way. Try to determine for your particular transport protocol how
strings are encoded; I bet they are not terminated by newline
characters.
Regards,
Nico
--- In [EMAIL PROTECTED], "Yusrizal Fahmi"
<[EMAIL PROTECTED]> wrote:
>
> Hi All,
> I try to catch message from my client over socket. the message
contains
> text and character hexadecimal, ex: chr(1C), chr(1D). Everytime my
> client send the message, i never accepted, but when my client close
the
> socket, all the message appear in my server program. It seems like
the
> message been hold in stack memory or something, i don't know.
> the code in server side is:
>
> BufferedReader inFromClient;
> DataOutputStream outToClient;
> String dataFromClient;
> try {
> inFromClient=new BufferedReader(new
> InputStreamReader(serverSocket.getInputStream()));
> boolean isQuit=false;
> while (!isQuit) {
> dataFromClient=inFromClient.readLine();
> System.out.println(dataFromClient);
> }
> inFromClient.close();
> serverSocket.close();
> }
> catch(IOException ioe) {
> System.out.println("error: " + ioe);
> }
>
> where do i wrong?, please help me.
>
> Regard
> yugi
------------------------ Yahoo! Groups Sponsor --------------------~-->
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/5cFolB/TM
--------------------------------------------------------------------~->
If you have any comments or questions, submit it on the message board.
NO spam/ads/job posting or you will be BANNED from this group. Exception can be
made it happen by notify me ahead of time.
all new members' message will be verified by me (spam..) before it get posted.
Yahoo! Groups Links
<*> To reply to this message, go to:
http://groups.yahoo.com/group/java_official/post?act=reply&messageNum=17393
Please do not reply to this message via email. More information here:
http://help.yahoo.com/help/us/groups/messages/messages-23.html
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/java_official/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/