Re: Perl Socket question
From: Peter Scott (peter_at_PSDT.com)
Date: 02/24/04
- Next message: Mike Mimic: "Test open ports"
- Previous message: Anno Siegel: "Re: replacing this backlash (\) with no backlash"
- In reply to: Ken Browning: "Perl Socket question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 24 Feb 2004 15:55:50 GMT
In article <403a52b3@127.0.0.1>,
"Ken Browning" <kenbrow@bellsouth.net> writes:
>I am having a problem with what I thought was a simple topic - take the
>following line of code:
>while (defined ($line = <$handle>))
>
>I have written a simple client using the above code - does this code block
>until it gets a carriage return from the server end?
Er, what did you think the implication of "$line" was?
It will not go on until it receives characters terminated by \n or gets
an eof. Properly-behaved servers should be sending CRLF-terminated lines.
>My client seems to
>pause a long time (a few seconds) when receiving data. I have connected to
>the server port directly using telnet and the data sent by the server is
>sent back to the client (telnet client) much faster than it is to my
>program.
Take a look on CPAN for some of the modules for simplifying client/server
writing. Especially if your server is speaking a standard protocol; there
may already be a module for receiving it.
-- Peter Scott http://www.perldebugged.com/ *** NEW *** http//www.perlmedic.com/
- Next message: Mike Mimic: "Test open ports"
- Previous message: Anno Siegel: "Re: replacing this backlash (\) with no backlash"
- In reply to: Ken Browning: "Perl Socket question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|