@@ -391,26 +391,26 @@ extension SocketDescriptor {
391391 ///
392392 /// The corresponding C function is `sendmsg`.
393393 @_alwaysEmitIntoClient
394- public func sendMessage (
395- bytes: UnsafeRawBufferPointer ,
396- recipient: SocketAddress ? = nil ,
394+ public func send (
395+ _ bytes: UnsafeRawBufferPointer ,
396+ to recipient: SocketAddress ? = nil ,
397397 ancillary: AncillaryMessageBuffer ? = nil ,
398398 flags: MessageFlags = [ ] ,
399399 retryOnInterrupt: Bool = true
400400 ) throws -> Int {
401- try _sendMessage (
402- bytes: bytes ,
403- recipient : recipient,
401+ try _send (
402+ bytes,
403+ to : recipient,
404404 ancillary: ancillary,
405405 flags: flags,
406406 retryOnInterrupt: retryOnInterrupt
407407 ) . get ( )
408408 }
409409
410410 @usableFromInline
411- internal func _sendMessage (
412- bytes: UnsafeRawBufferPointer ,
413- recipient: SocketAddress ? ,
411+ internal func _send (
412+ _ bytes: UnsafeRawBufferPointer ,
413+ to recipient: SocketAddress ? ,
414414 ancillary: AncillaryMessageBuffer ? ,
415415 flags: MessageFlags ,
416416 retryOnInterrupt: Bool
@@ -438,7 +438,7 @@ extension SocketDescriptor {
438438 }
439439 }
440440
441- internal func _sendmsg(
441+ private func _sendmsg(
442442 _ message: UnsafePointer < CInterop . MsgHdr > ,
443443 _ flags: CInt ,
444444 retryOnInterrupt: Bool
@@ -451,40 +451,19 @@ extension SocketDescriptor {
451451
452452// @available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
453453extension SocketDescriptor {
454-
455- /// Receive a message from a socket.
456- ///
457- /// TODO: describe every parameter and option.
458- ///
459- /// The corresponding C function is `recvmsg`.
460- @_alwaysEmitIntoClient
461- public func receiveMessage(
462- into bytes: UnsafeMutableRawBufferPointer ,
463- flags: MessageFlags = [ ] ,
464- retryOnInterrupt: Bool = true
465- ) throws -> ( received: Int , flags: MessageFlags ) {
466- return try _receiveMessage (
467- into: bytes,
468- sender: nil ,
469- ancillary: nil ,
470- flags: flags,
471- retryOnInterrupt: retryOnInterrupt
472- ) . get ( )
473- }
474-
475454 /// Receive a message from a socket.
476455 ///
477456 /// TODO: describe every parameter and option.
478457 ///
479458 /// The corresponding C function is `recvmsg`.
480459 @_alwaysEmitIntoClient
481- public func receiveMessage (
460+ public func receive (
482461 into bytes: UnsafeMutableRawBufferPointer ,
483462 sender: inout SocketAddress ,
484463 flags: MessageFlags = [ ] ,
485464 retryOnInterrupt: Bool = true
486465 ) throws -> ( received: Int , flags: MessageFlags ) {
487- return try _receiveMessage (
466+ return try _receive (
488467 into: bytes,
489468 sender: & sender,
490469 ancillary: nil ,
@@ -499,13 +478,13 @@ extension SocketDescriptor {
499478 ///
500479 /// The corresponding C function is `recvmsg`.
501480 @_alwaysEmitIntoClient
502- public func receiveMessage (
481+ public func receive (
503482 into bytes: UnsafeMutableRawBufferPointer ,
504483 ancillary: inout AncillaryMessageBuffer ,
505484 flags: MessageFlags = [ ] ,
506485 retryOnInterrupt: Bool = true
507486 ) throws -> ( received: Int , flags: MessageFlags ) {
508- return try _receiveMessage (
487+ return try _receive (
509488 into: bytes,
510489 sender: nil ,
511490 ancillary: & ancillary,
@@ -520,14 +499,14 @@ extension SocketDescriptor {
520499 ///
521500 /// The corresponding C function is `recvmsg`.
522501 @_alwaysEmitIntoClient
523- public func receiveMessage (
502+ public func receive (
524503 into bytes: UnsafeMutableRawBufferPointer ,
525504 sender: inout SocketAddress ,
526505 ancillary: inout AncillaryMessageBuffer ,
527506 flags: MessageFlags = [ ] ,
528507 retryOnInterrupt: Bool = true
529508 ) throws -> ( received: Int , flags: MessageFlags ) {
530- return try _receiveMessage (
509+ return try _receive (
531510 into: bytes,
532511 sender: & sender,
533512 ancillary: & ancillary,
@@ -539,7 +518,7 @@ extension SocketDescriptor {
539518
540519extension SocketDescriptor {
541520 @usableFromInline
542- internal func _receiveMessage (
521+ internal func _receive (
543522 into bytes: UnsafeMutableRawBufferPointer ,
544523 sender: UnsafeMutablePointer < SocketAddress > ? ,
545524 ancillary: UnsafeMutablePointer < AncillaryMessageBuffer > ? ,
0 commit comments