Results 1 to 3 of 3
Like Tree1Likes
  • 1 Post By DarrylBurke

Thread: reading unformatted data(i.e that string do not having line termination characters)

  1. #1
    amjhanwar is offline Member
    Join Date
    Aug 2012
    Posts
    1
    Rep Power
    0

    Default reading unformatted data(i.e that string do not having line termination characters)

    I have a server socket application which listens on particular ip and port. Then I have client socket which reads input from server and give response.
    But my problem is that server do not formatted line termination characters at the end. so when i use buffered reader readline method it hangs. so how should i read the data send by server.
    here server is basically a API(METER).

    Thanks in advance.

    Please reply at earliest.

    I am also enclosing herewith sample request /response between server and client.

    Request: 8/2/2012 3:28:24 PM.60764 (+0.0000 seconds)

    53 0D S.

    Answer: 8/2/2012 3:28:24 PM.87364 (+0.2656 seconds)

    53 50 31 39 35 30 34 37 38 34 0D SP19504784.

    Request: 8/2/2012 3:28:24 PM.92064 (+0.0000 seconds)

    53 48 0D SH.

    Answer: 8/2/2012 3:28:24 PM.02964 (+0.1094 seconds)

    53 48 0D SH.
    Request: 8/2/2012 3:28:26 PM.81164 (+0.0000 seconds)

    CA F0 00 00 00 00 00 00 00 3A Êð.......:

    Answer: 8/2/2012 3:28:26 PM.02964 (+0.2188 seconds)

    C4 00 05 00 C9 31 36 38 C4 B7 B7 3F 2E C9 74 5A Ä...É168Ä··?.ÉtZ
    02 00 02 00 FE FC C9 A1 0D 07 00 FB FF FD FC C9 ....þüÉ¡...ûÿýüÉ
    1E 0E FD FF FE FF FD FC C9 B8 FE 4E FF FA 01 FF ..ýÿþÿýüɸþNÿú.ÿhttp://www.java-forums.org/images/sm...pe/(shake).gif
    FF B9 D0 F9 F0 3F D0 BF 50 9F ÿ¹Ðùð?пP?

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    14,795
    Rep Power
    20

    Default Re: reading unformatted data(i.e that string do not having line termination character

    If you don't understand my response, don't ignore it, ask a question.

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is online now Moderator
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    10,101
    Rep Power
    17

    Default Re: reading unformatted data(i.e that string do not having line termination character

    Also cross posted and already answered at reading unformatted data from socket in java - Stack Overflow

    I'm closing this thread so that members here won't have to waste their time.

    db

    THREAD CLOSED
    Fubarable likes this.
    Why do they call it rush hour when nothing moves? - Robin Williams

Similar Threads

  1. Reading characters into a string
    By Teclis in forum New To Java
    Replies: 2
    Last Post: 03-08-2011, 10:08 PM
  2. Replies: 1
    Last Post: 02-13-2011, 03:09 PM
  3. Replies: 9
    Last Post: 04-07-2009, 03:51 AM
  4. Reading in data from file line by line
    By bluekswing in forum New To Java
    Replies: 1
    Last Post: 10-02-2007, 12:19 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •