相关代码 |
|
程序清单17-7:disconnect.pl sub disconnect { my $conn = shift; my $sock = delete $conn->{sock}; return unless defined($sock); set_event_handler ($sock, "read" => undef, "write" => undef); close($sock); undef $!; # Should ideally process errors from close } # send_now()函数实现 sub send_now { my ($conn, $msg) = @_; _enqueue ($conn, $msg); $conn->_send (1); # 1 ==> flush }
相关资源 |
|