projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
*** empty log message ***
[spider.git]
/
perl
/
Msg.pm
diff --git
a/perl/Msg.pm
b/perl/Msg.pm
index 20e000334ca5d72d103d51e63f17694ea643bc88..9df7640ecbbfbfecd5a80493469a5abacb1700f5 100644
(file)
--- a/
perl/Msg.pm
+++ b/
perl/Msg.pm
@@
-67,7
+67,8
@@
sub disconnect {
my $sock = delete $conn->{sock};
return unless defined($sock);
set_event_handler ($sock, "read" => undef, "write" => undef);
my $sock = delete $conn->{sock};
return unless defined($sock);
set_event_handler ($sock, "read" => undef, "write" => undef);
- close($sock);
+ shutdown($sock, 3);
+ close($sock);
}
sub send_now {
}
sub send_now {
@@
-165,6
+166,7
@@
sub set_blocking {
fcntl ($_[0], F_SETFL(), $flags);
}
}
fcntl ($_[0], F_SETFL(), $flags);
}
}
+
sub handle_send_err {
# For more meaningful handling of send errors, subclass Msg and
# rebless $conn.
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
#----------------------------------------------------
# Event loop routines used by both client and server