Re: Perl Socket question

From: Peter Scott (peter_at_PSDT.com)
Date: 02/24/04


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/


Relevant Pages

  • Re: What doesnt lend itself to OO?
    ... >> proxy and instructs the server to constuct the real object. ... rather than client code. ... If 'clock' is instantiated in the server, ... > for the server interface at the OOA level. ...
    (comp.object)
  • This is going straight to the pool room
    ... or not the client has privilege to do what they're trying to do, ... The server environment is this: ... 3GL User action Routines that Tier3 will execute on your behalf during the ... Routine Name: USER_INIT ...
    (comp.os.vms)
  • [Full-Disclosure] R: Full-Disclosure Digest, Vol 3, Issue 42
    ... Full-Disclosure Digest, Vol 3, Issue 42 ... SD Server 4.0.70 Directory Traversal Bug ... Arkeia Network Backup Client Remote Access ...
    (Full-Disclosure)
  • Re: What doesnt lend itself to OO?
    ... > rather than client code. ... no way to do that without also touching the object with clock semantics ... will not encapsulate both clock semantics and network semantics. ... The server can do whatever it wants ...
    (comp.object)
  • RE: Fax monitor incoming + outgoing calls?
    ... problem between the client computer and the SBS server. ... Client is using the internal IP address of the SBS server as the ... To the folder redirection GPO issue: ...
    (microsoft.public.windows.server.sbs)