X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FMsg.pm;h=9df7640ecbbfbfecd5a80493469a5abacb1700f5;hb=632bda2671a8b0cf73b1a0bffa7b906c8744b14f;hp=65a32a662c64e7e1ec82df62d2bc94ba19cd848f;hpb=b4826d1f4125788e14fed3adbb99e66242904e74;p=spider.git diff --git a/perl/Msg.pm b/perl/Msg.pm index 65a32a66..9df7640e 100644 --- a/perl/Msg.pm +++ b/perl/Msg.pm @@ -68,6 +68,7 @@ sub disconnect { return unless defined($sock); set_event_handler ($sock, "read" => undef, "write" => undef); shutdown($sock, 3); + close($sock); } sub send_now { @@ -165,6 +166,7 @@ sub set_blocking { fcntl ($_[0], F_SETFL(), $flags); } } + sub handle_send_err { # For more meaningful handling of send errors, subclass Msg and # rebless $conn. @@ -277,6 +279,13 @@ sub _new_client { } } +sub close_server +{ + set_event_handler ($main_socket, "read" => undef); + $main_socket->close; + $main_socket = 0; +} + #---------------------------------------------------- # Event loop routines used by both client and server