in reply to Re^4: [threads] Sharing object through threads
in thread [threads] Sharing object through threads
sub new_inet_from_fd { my ($fd, %arg) = @_; my $timeout = delete $arg{Timeout}; my $blocking = exists $arg{Blocking} ? delete $arg{Blocking} : 1; my $sock = IO::Socket::INET->IO::Handle::new_from_fd($fd, '+<'); ${*$sock}{'io_socket_timeout'} = $timeout; ${*$sock}{io_sock_nonblocking} = !$blocking; $sock->blocking($blocking); $sock->autoflush(1); return $sock; }
It produces a socket whose operations don't timeout (unless one is specified), whose operations do block (unless otherwise specified), and that does autoflush. Everything in IO::Handle other than autoflush is at its default.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^6: [threads] Sharing object through threads
by BrowserUk (Patriarch) on Nov 17, 2009 at 22:22 UTC | |
by ikegami (Patriarch) on Nov 17, 2009 at 22:30 UTC |