S
Song Lining
Hi, guys
Got a very frustrating problem while writing a perl socket client to
connect to a server.
The perl client will quit by itself everytime I stop the server and
the errno is either "ECONNRESET: Connection aborted" or "ECONNABORTED:
Connection reset by peer". The problem is that I need to keep the
client alive even the server is shutdown, so I tried to ignore all the
signals in %SIG but that didn't help either. Here's a snipet of the
code:
<code>
....
foreach (keys %SIG) {
print "$_\n";
$SIG{$_} = 'IGNORE';
}
....
....
$sock = new IO::Socket::INET(
PeerAddr => $PeerAddr,
PeerPort => $PeerPort,
Proto => 'tcp',
);
....
....
</code>
As you can see, it's a very simple and straitforward code but how can
it stop exiting??? I think there must be at least one easy way to do
it
Any clue would be much appreciated!
Thanks!
Song Lining
Got a very frustrating problem while writing a perl socket client to
connect to a server.
The perl client will quit by itself everytime I stop the server and
the errno is either "ECONNRESET: Connection aborted" or "ECONNABORTED:
Connection reset by peer". The problem is that I need to keep the
client alive even the server is shutdown, so I tried to ignore all the
signals in %SIG but that didn't help either. Here's a snipet of the
code:
<code>
....
foreach (keys %SIG) {
print "$_\n";
$SIG{$_} = 'IGNORE';
}
....
....
$sock = new IO::Socket::INET(
PeerAddr => $PeerAddr,
PeerPort => $PeerPort,
Proto => 'tcp',
);
....
....
</code>
As you can see, it's a very simple and straitforward code but how can
it stop exiting??? I think there must be at least one easy way to do
it
Any clue would be much appreciated!
Thanks!
Song Lining