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

send and recv

January 30, 2002 17:41
send and recv
Message ID:
Fiddling about with sockets, having some problems with send and recv.
Connecting successfully to an SMTP server, the following lines have odd

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?


This dress exacerbates the genetic travesty that is my legacy.
   -Heather (from Romy and Michelle) Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About