in reply to Question from socket newbie

A few thoughts come to mind:

  1. The server isn't flushing its buffer
  2. If the protocol specifies a new line, but the server doesn't send one, then the server is violating the protocol
  3. If the protocol doesn't specify a new line, then your program can't assume there will be one

The first two are solved at the server end. For #1, set $| = 1; (assuming it's in Perl--other languages should have some method for flushing the buffer). For #2, you need to add a new line to the server's output.

If #3 is the problem, you need to read the protocol docs more carefuly :)

----
I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
-- Schemer

Note: All code is untested, unless otherwise stated

Replies are listed 'Best First'.
Re: Re: Question from socket newbie
by Melly (Chaplain) on Sep 26, 2003 at 16:17 UTC

    I think it's #3 (and it's not a perl server) - no protocol has been supplied. We've established the problem, I'm just not sure how to resolve it (i.e. how do I get perl to read from a socket buffer when the content isn't newline terminated).

    Tom Melly, tom@tomandlu.co.uk