> -----Original Message----- > From: Gabor Urban [mailto:[EMAIL PROTECTED] > Sent: Friday, June 27, 2003 6:13 AM > To: [EMAIL PROTECTED] > Subject: Socket question > > > Hi, > > I am still working on a socket problem at low level, and there is > something I wander. Are Perl socket bidirectional? I am currently work > to test an Apache module, that processes HTTP POST requests. I thought > at the beginning, that a Perl script would do perfect for me. > > Code fragment: > > send SOCK, "$lines\n",MSG_OOB ; > > > $res = recv SOCK, $line,1024,MSG_OOB ; > while ( defined($res) ) > { > print $line ; > $res = recv SOCK, $line,1024,MSG_OOB ; > } > > print "Closed\n" ; > close SOCK ; > > So, the request is sent correctly, I could verify from the acces-log, > and it is processed properly by the module· It seems, the script > closes down before anything is recevied from Apache. > > The socket was opened by the following code: > > socket(SOCK, PF_INET, SOCK_STREAM, $proto) || die > "socket: $!"; > connect(SOCK, $paddr) || die "connect: $!"; > > print "Host reached\n-----------------\n" ; > > I would appreciate any idea.
I believe all you do is something like: $ret = <SOCK>; which reads a line from the socket. -Mark -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]