Client crash making server crash
[email protected] (Eric Martel) Fri, 19 Aug 2011 14:43:50 -0400
| Newsgroups | perl.poe |
|---|---|
| Message-ID | <[email protected]> |
Hi folks, I'm quite new to POE. I wrote a server using POE::Wheel::SocketFactory and handling clients with POE::Wheel::ReadWrite, and everything works fine but for one thing: there are moments when a client and the server will cross-exchange much data (that is, the client sends data to the server, which replies with other data, an this multiple times until they are finished), and I happened to notice that if the client is killed before the end, the server will die, which is not what I want... The server crashes in Kernel.pm, at the line "confess unless defined $session;" (line 1012 as of v1.311) within _dispatch_event(). What I guess is happening (but I may be wrong) is that a '$client_wheel->put($data)' is made before the client is killed, and when POE tries to actually handle the put(), the client wheel session is already no longer accessible, before any ErrorEvent handler could be called. Am I right on this? I could not find any way I could prevent this, but surely there must be...? I wonder if replacing the "confess" line by a simple "warn + return" (or the like) could do the trick? Any help would be greatly appreciated. -- Eric Martel Québec (Québec) Canada Ce courriel est signé numériquement avec la clef suivante: This e-mail is digitally signed with the following key: ED3F191C (key://pgp.mit.edu, http://key.ericmartel.net/) Pour plus d'information: http://gpg.ericmartel.net/ For more info: http://www.gnupg.org/
eric.vcf
(text/x-vcard, 122 B)
begin:vcard fn:Eric Martel n:Martel;Eric email;internet:[email protected] tel;fax:1-888-384-9136 version:2.1 end:vcard
signature.asc
(application/pgp-signature, 262 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk5OrukACgkQ8B7YqO0/GRx8+wCfcpZet6DqkzQgrjOisT5NFm9c 74cAnjzKpFlUqTcZ+BszXvrbgOSgooEL =AkBB -----END PGP SIGNATURE-----