a working version?
[spider.git] / perl / Msg.pm
index aaa38b533b47397ac40193c82fe771872e52d7d7..9df7640ecbbfbfecd5a80493469a5abacb1700f5 100644 (file)
@@ -166,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.  
@@ -278,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