File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -274,18 +274,21 @@ pub fn (mut s UdpSocket) set_dualstack(on bool) ! {
274274 sizeof (int )))!
275275}
276276
277- fn (mut s UdpSocket) close () ! {
277+ // close shuts down and closes the socket for communication.
278+ pub fn (mut s UdpSocket) close () ! {
278279 shutdown (s.handle)
279280 return close (s.handle)
280281}
281282
282- fn (mut s UdpSocket) select (test Select, timeout time.Duration) ! bool {
283+ // select waits for no more than `timeout` for the IO operation, defined by `test`, to be available.
284+ pub fn (mut s UdpSocket) select (test Select, timeout time.Duration) ! bool {
283285 return select (s.handle, test, timeout)
284286}
285287
286- fn (s &UdpSocket) remote () ! Addr {
288+ // remote returns the remote `Addr` address of the socket or `none` if no remote is has been resolved.
289+ pub fn (s &UdpSocket) remote () ? Addr {
287290 if s.has_r {
288291 return s.r
289292 }
290- return error ( ' none' )
293+ return none
291294}
You can’t perform that action at this time.
0 commit comments