[LA.pm] Hi all - a question on socket client

Kevin Scaldeferri kevin at scaldeferri.com
Mon May 3 11:42:14 CDT 2004


Ranga Nathan wrote:

>
>
> Got a question. I am testing a server that is running on the Big Iron. 
> This trivial server simply echoes input and disconnects upon receiving 
> 'END' or 'end'.
> When I run a telnet client from my linux box, it works fine. However 
> when I run my perl socket client, it blocks on receive. That is, the 
> script seems to 'hang' when it is receving. Seems like he is not 
> seeing something telling him that there is no more. Has 'select' 
> anything to do with it?
>
Probably the lack of newline here is your problem:


>
> print $sock "USQ1";


Since your socket connection is line-buffered, this hasn't actually been 
sent to the server at the point when you start listening on the next line.



Kevin



More information about the Losangeles-pm mailing list