@@ -124,6 +124,7 @@ impl Socket {
124
124
/// the socket is made non-inheritable.
125
125
///
126
126
/// [`Socket::new_raw`] can be used if you don't want these flags to be set.
127
+ #[ doc = man_links ! ( socket( 2 ) ) ]
127
128
pub fn new ( domain : Domain , ty : Type , protocol : Option < Protocol > ) -> io:: Result < Socket > {
128
129
let ty = set_common_type ( ty) ;
129
130
Socket :: new_raw ( domain, ty, protocol) . and_then ( set_common_flags)
@@ -144,6 +145,7 @@ impl Socket {
144
145
///
145
146
/// This function sets the same flags as in done for [`Socket::new`],
146
147
/// [`Socket::pair_raw`] can be used if you don't want to set those flags.
148
+ #[ doc = man_links ! ( unix: socketpair( 2 ) ) ]
147
149
#[ cfg( any( doc, all( feature = "all" , unix) ) ) ]
148
150
#[ cfg_attr( docsrs, doc( cfg( all( feature = "all" , unix) ) ) ) ]
149
151
pub fn pair (
@@ -177,6 +179,7 @@ impl Socket {
177
179
///
178
180
/// This function directly corresponds to the `bind(2)` function on Windows
179
181
/// and Unix.
182
+ #[ doc = man_links ! ( bind( 2 ) ) ]
180
183
pub fn bind ( & self , address : & SockAddr ) -> io:: Result < ( ) > {
181
184
sys:: bind ( self . as_raw ( ) , address)
182
185
}
@@ -188,6 +191,7 @@ impl Socket {
188
191
///
189
192
/// An error will be returned if `listen` or `connect` has already been
190
193
/// called on this builder.
194
+ #[ doc = man_links ! ( connect( 2 ) ) ]
191
195
///
192
196
/// # Notes
193
197
///
@@ -242,6 +246,7 @@ impl Socket {
242
246
///
243
247
/// An error will be returned if `listen` or `connect` has already been
244
248
/// called on this builder.
249
+ #[ doc = man_links ! ( listen( 2 ) ) ]
245
250
pub fn listen ( & self , backlog : c_int ) -> io:: Result < ( ) > {
246
251
sys:: listen ( self . as_raw ( ) , backlog)
247
252
}
@@ -253,6 +258,7 @@ impl Socket {
253
258
///
254
259
/// This function sets the same flags as in done for [`Socket::new`],
255
260
/// [`Socket::accept_raw`] can be used if you don't want to set those flags.
261
+ #[ doc = man_links ! ( accept( 2 ) ) ]
256
262
pub fn accept ( & self ) -> io:: Result < ( Socket , SockAddr ) > {
257
263
// Use `accept4` on platforms that support it.
258
264
#[ cfg( any(
@@ -299,6 +305,10 @@ impl Socket {
299
305
300
306
/// Returns the socket address of the local half of this socket.
301
307
///
308
+ /// This function directly corresponds to the `getsockname(2)` function on
309
+ /// Windows and Unix.
310
+ #[ doc = man_links ! ( getsockname( 2 ) ) ]
311
+ ///
302
312
/// # Notes
303
313
///
304
314
/// Depending on the OS this may return an error if the socket is not
@@ -311,6 +321,10 @@ impl Socket {
311
321
312
322
/// Returns the socket address of the remote peer of this socket.
313
323
///
324
+ /// This function directly corresponds to the `getpeername(2)` function on
325
+ /// Windows and Unix.
326
+ #[ doc = man_links ! ( getpeername( 2 ) ) ]
327
+ ///
314
328
/// # Notes
315
329
///
316
330
/// This returns an error if the socket is not [`connect`ed].
@@ -359,6 +373,7 @@ impl Socket {
359
373
///
360
374
/// This function will cause all pending and future I/O on the specified
361
375
/// portions to return immediately with an appropriate value.
376
+ #[ doc = man_links ! ( shutdown( 2 ) ) ]
362
377
pub fn shutdown ( & self , how : Shutdown ) -> io:: Result < ( ) > {
363
378
sys:: shutdown ( self . as_raw ( ) , how)
364
379
}
@@ -368,6 +383,7 @@ impl Socket {
368
383
///
369
384
/// The [`connect`] method will connect this socket to a remote address.
370
385
/// This method might fail if the socket is not connected.
386
+ #[ doc = man_links ! ( recv( 2 ) ) ]
371
387
///
372
388
/// [`connect`]: Socket::connect
373
389
///
@@ -419,6 +435,7 @@ impl Socket {
419
435
/// In addition to the number of bytes read, this function returns the flags
420
436
/// for the received message. See [`RecvFlags`] for more information about
421
437
/// the returned flags.
438
+ #[ doc = man_links ! ( recvmsg( 2 ) ) ]
422
439
///
423
440
/// [`recv`]: Socket::recv
424
441
/// [`connect`]: Socket::connect
@@ -484,6 +501,7 @@ impl Socket {
484
501
485
502
/// Receives data from the socket. On success, returns the number of bytes
486
503
/// read and the address from whence the data came.
504
+ #[ doc = man_links ! ( recvfrom( 2 ) ) ]
487
505
///
488
506
/// # Safety
489
507
///
@@ -510,6 +528,7 @@ impl Socket {
510
528
/// Receives data from the socket. Returns the amount of bytes read, the
511
529
/// [`RecvFlags`] and the remote address from the data is coming. Unlike
512
530
/// [`recv_from`] this allows passing multiple buffers.
531
+ #[ doc = man_links ! ( recvmsg( 2 ) ) ]
513
532
///
514
533
/// [`recv_from`]: Socket::recv_from
515
534
///
@@ -573,6 +592,7 @@ impl Socket {
573
592
/// been connected.
574
593
///
575
594
/// On success returns the number of bytes that were sent.
595
+ #[ doc = man_links ! ( send( 2 ) ) ]
576
596
pub fn send ( & self , buf : & [ u8 ] ) -> io:: Result < usize > {
577
597
self . send_with_flags ( buf, 0 )
578
598
}
@@ -594,6 +614,7 @@ impl Socket {
594
614
595
615
/// Identical to [`send_vectored`] but allows for specification of arbitrary
596
616
/// flags to the underlying `sendmsg`/`WSASend` call.
617
+ #[ doc = man_links ! ( sendmsg( 2 ) ) ]
597
618
///
598
619
/// [`send_vectored`]: Socket::send_vectored
599
620
#[ cfg( not( target_os = "redox" ) ) ]
@@ -621,6 +642,7 @@ impl Socket {
621
642
/// number of bytes written.
622
643
///
623
644
/// This is typically used on UDP or datagram-oriented sockets.
645
+ #[ doc = man_links ! ( sendto( 2 ) ) ]
624
646
pub fn send_to ( & self , buf : & [ u8 ] , addr : & SockAddr ) -> io:: Result < usize > {
625
647
self . send_to_with_flags ( buf, addr, 0 )
626
648
}
@@ -640,6 +662,7 @@ impl Socket {
640
662
641
663
/// Send data to a peer listening on `addr`. Returns the amount of bytes
642
664
/// written.
665
+ #[ doc = man_links ! ( sendmsg( 2 ) ) ]
643
666
#[ cfg( not( target_os = "redox" ) ) ]
644
667
#[ cfg_attr( docsrs, doc( cfg( not( target_os = "redox" ) ) ) ) ]
645
668
pub fn send_to_vectored ( & self , bufs : & [ IoSlice < ' _ > ] , addr : & SockAddr ) -> io:: Result < usize > {
0 commit comments