Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I've noticed that if the client is abruptly disconneced that the server will crash when $client->send() is called. How can I be sure that the client is still valid before the $client->send() command is issued? Just checking that $client still exists isn't enough, it seems to exist long enough after a disconnect to cause problems.my($client, $client_addr) = $server->accept();
#only send if $client exists $client->send() if $client;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Client still valid?
by Zaxo (Archbishop) on Aug 04, 2003 at 23:58 UTC | |
by Anonymous Monk on Aug 05, 2003 at 00:45 UTC | |
by Zaxo (Archbishop) on Aug 05, 2003 at 00:55 UTC | |
|
Re: Client still valid?
by sgifford (Prior) on Aug 05, 2003 at 02:22 UTC | |
|
Re: Client still valid?
by adrianh (Chancellor) on Aug 04, 2003 at 23:54 UTC |