… | |
… | |
152 | |
152 | |
153 | $fh; |
153 | $fh; |
154 | } |
154 | } |
155 | |
155 | |
156 | =item connect, listen, bind, getsockopt, setsockopt, |
156 | =item connect, listen, bind, getsockopt, setsockopt, |
157 | send, recv, peername, sockname |
157 | send, recv, peername, sockname, shutdown |
158 | |
158 | |
159 | Do the same thing as the perl builtins or IO::Socket methods (but return |
159 | Do the same thing as the perl builtins or IO::Socket methods (but return |
160 | true on EINPROGRESS). Remember that these must be method calls. |
160 | true on EINPROGRESS). Remember that these must be method calls. |
161 | |
161 | |
162 | =cut |
162 | =cut |
… | |
… | |
168 | sub setsockopt { setsockopt tied(${$_[0]})->[0], $_[1], $_[2], $_[3] } |
168 | sub setsockopt { setsockopt tied(${$_[0]})->[0], $_[1], $_[2], $_[3] } |
169 | sub send { send tied(${$_[0]})->[0], $_[1], $_[2], @_ > 2 ? $_[3] : () } |
169 | sub send { send tied(${$_[0]})->[0], $_[1], $_[2], @_ > 2 ? $_[3] : () } |
170 | sub recv { recv tied(${$_[0]})->[0], $_[1], $_[2], @_ > 2 ? $_[3] : () } |
170 | sub recv { recv tied(${$_[0]})->[0], $_[1], $_[2], @_ > 2 ? $_[3] : () } |
171 | sub sockname { getsockname tied(${$_[0]})->[0] } |
171 | sub sockname { getsockname tied(${$_[0]})->[0] } |
172 | sub peername { getpeername tied(${$_[0]})->[0] } |
172 | sub peername { getpeername tied(${$_[0]})->[0] } |
|
|
173 | sub shutdown { shutdown tied(${$_[0]})->[0] } |
173 | |
174 | |
174 | =item ($peername, $fh) = $listen_fh->accept |
175 | =item ($peername, $fh) = $listen_fh->accept |
175 | |
176 | |
176 | In scalar context, returns the newly accepted socket (or undef) and in |
177 | In scalar context, returns the newly accepted socket (or undef) and in |
177 | list context return the ($fh, $peername) pair (or nothing). |
178 | list context return the ($fh, $peername) pair (or nothing). |