|
|
sybperl-l Archive
Up Prev Next
From: Richard Lee <richard dot lee at gs dot com>
Subject: socket problem
Date: Feb 1 1996 2:53PM
Help,
We are running Perl 5.001 with sybperl 2, and having intermittent
socket disconnect problems with the following codes. The connection
will just drop in middle of transmission, which caused a PIPE signal.
The configuration is Server written in C with the client written in Perl,
on SparcStation 20 with Sun 4.1.3u1.
The message protocol between server and client is a C structure of 240 bytes,
but only the first ~20 bytes are used.
Following is the code in the client :
$ret = bind(SL_LOANET_HANDLE, $lcl_addr);
....
$ret = connect(SL_LOANET_HANDLE, $srv_addr);
....
$req_cmd = 71;
$req_loanet_id = 12345678;
c$$req_client_id = 'XYZW';
$CLIENT_REQUEST = pack("i i A4", $req_cmd, $req_loanet_id, $req_client_id);
$ret = printf SL_LOANET_HANDLE "%s", $CLIENT_REQUEST ;
......
recv(SL_LOANET_HANDLE,$LOANET_RETURN,240,$FLAGS);
The problem on the client side is that the returned packet $LOANET_RETURN is zero byte.
When client try to write the socket again, a PIPE signal will be generated.
Could this be the problem with word boundary problem of integer and float
on the hardware ?
Thanks for your help.
--Richard Lee
-- Goldman Sachs 212-902-2977
|