Peter Scott wrote:

> At 10:13 AM 7/6/01 -0400, Stephen LeClaire wrote:
> >I have a client server configured using the inetd daemon to call the
> >server software.  Most of the time, the server grabs all of the data
> >sent by the client, but sometimes the server only grabs a portion of the
> >data.  I have verified, using snoop, that all the data from the client
> >makes it to the server.
> >
> >The server script simply reads the standard input:  "$msg = <STDIN>".  I
> >tried doing a "while ($msg = <STDIN>)"  but it just causes things to
> >hang.   Any ideas and insights are greatly appreciated.
>
> Depends on what your protocol is.  The server will read up until the first
> newline with your current approach.  With your attempted approach it will
> read until the socket is closed by the client, which I gather it isn't.  So
> you need to define your protocol so that the server can know when the
> client has finished sending (that, or fork separate reading/writing
> processes, or use select with a timeout).
> --
> Peter Scott
> Pacific Systems Design Technologies
> http://www.perldebugged.com

Peter,

Thanks for the input.  I failed to mention that the protocol is tcp.  The
first newline is what bothers me.  I send a newline at the end of the string
and the string does not contain a newline.  I can send the same string
repeatably with success but it will eventually fail.  Again, any further input
is greatly appreciated.

Steve

Reply via email to