@@ -79,7 +79,7 @@ extension SocketDescriptor {
7979 nothingOrErrno ( system_listen ( self . rawValue, CInt ( backlog) ) )
8080 }
8181
82- /// Send a message from a socket
82+ /// Send a message from a socket.
8383 ///
8484 /// - Parameters:
8585 /// - buffer: The region of memory that contains the data being sent.
@@ -90,7 +90,7 @@ extension SocketDescriptor {
9090 /// Pass `false` to try only once and throw an error upon interruption.
9191 /// - Returns: The number of bytes that were sent.
9292 ///
93- /// The corresponding C function is `send`
93+ /// The corresponding C function is `send`.
9494 @_alwaysEmitIntoClient
9595 public func send(
9696 _ buffer: UnsafeRawBufferPointer ,
@@ -111,7 +111,7 @@ extension SocketDescriptor {
111111 }
112112 }
113113
114- /// Send a message from a socket
114+ /// Send a message from a socket.
115115 ///
116116 /// - Parameters:
117117 /// - buffer: The region of memory that contains the data being sent.
@@ -123,7 +123,7 @@ extension SocketDescriptor {
123123 /// Pass `false` to try only once and throw an error upon interruption.
124124 /// - Returns: The number of bytes that were sent.
125125 ///
126- /// The corresponding C function is `sendto`
126+ /// The corresponding C function is `sendto`.
127127 @_alwaysEmitIntoClient
128128 public func send(
129129 _ buffer: UnsafeRawBufferPointer ,
@@ -159,7 +159,7 @@ extension SocketDescriptor {
159159 }
160160 }
161161
162- /// Receive a message from a socket
162+ /// Receive a message from a socket.
163163 ///
164164 /// - Parameters:
165165 /// - buffer: The region of memory to receive into.
@@ -170,7 +170,7 @@ extension SocketDescriptor {
170170 /// Pass `false` to try only once and throw an error upon interruption.
171171 /// - Returns: The number of bytes that were received.
172172 ///
173- /// The corresponding C function is `recv`
173+ /// The corresponding C function is `recv`.
174174 @_alwaysEmitIntoClient
175175 public func receive(
176176 into buffer: UnsafeMutableRawBufferPointer ,
@@ -193,18 +193,21 @@ extension SocketDescriptor {
193193 }
194194 }
195195
196- /// Receive a message from a socket
196+ /// Receive a message from a socket.
197197 ///
198198 /// - Parameters:
199199 /// - buffer: The region of memory to receive into.
200200 /// - flags: see `recv(2)`
201+ /// - sender: A socket address with enough capacity to hold an
202+ /// address for the current socket domain/type. On return, `receive`
203+ /// overwrites the contents with the address of the remote client.
201204 /// - retryOnInterrupt: Whether to retry the receive operation
202205 /// if it throws ``Errno/interrupted``.
203206 /// The default is `true`.
204207 /// Pass `false` to try only once and throw an error upon interruption.
205208 /// - Returns: The number of bytes that were received.
206209 ///
207- /// The corresponding C function is `recvfrom`
210+ /// The corresponding C function is `recvfrom`.
208211 @_alwaysEmitIntoClient
209212 public func receive(
210213 into buffer: UnsafeMutableRawBufferPointer ,
@@ -289,12 +292,9 @@ extension SocketDescriptor {
289292 }
290293 }
291294
292- // TODO: acceptAndSockaddr or something that (tries to) returns the sockaddr
293- // at least, for sockaddrs up to some sane length
294-
295- /// Bind a name to a socket
295+ /// Bind a name to a socket.
296296 ///
297- /// The corresponding C function is `bind`
297+ /// The corresponding C function is `bind`.
298298 @_alwaysEmitIntoClient
299299 public func bind( to address: SocketAddress ) throws {
300300 try _bind ( to: address) . get ( )
@@ -308,9 +308,9 @@ extension SocketDescriptor {
308308 return nothingOrErrno ( success)
309309 }
310310
311- /// Initiate a connection on a socket
311+ /// Initiate a connection on a socket.
312312 ///
313- /// The corresponding C function is `connect`
313+ /// The corresponding C function is `connect`.
314314 @_alwaysEmitIntoClient
315315 public func connect( to address: SocketAddress ) throws {
316316 try _connect ( to: address) . get ( )
0 commit comments