develooper Front page | perl.beginners | Postings from January 2002

send and recv

From:
Butterfly
Date:
January 30, 2002 17:41
Subject:
send and recv
Message ID:
20020131135942.A91745@vurt.net
Fiddling about with sockets, having some problems with send and recv.
Connecting successfully to an SMTP server, the following lines have odd
results:

$len=200;
recv SOCK, $foo, $len, 0;
print $foo;
send SOCK, "MAIL From:foo@bar.baz\n", 0;
recv SOCK, $foo, $len, 0;
print $foo;

SOCK is connected as per the example in the section on Sockets in the Camel.

The first print is working fine, the second is never reached.  If, however,
I lower the value of $len to something like 10 then it stampedes through
with nary a problem (except, of course, for the fact that it only receives
the first 10 chars of the mesg).  The send *seems* to be working, it's just
the 2nd recv that seems to be b0rking.  Can anyone shed any light on this?

-Madi

-- 
This dress exacerbates the genetic travesty that is my legacy.
   -Heather (from Romy and Michelle)



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About