File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -99,11 +99,11 @@ public struct Socket: Sendable, Hashable {
9999 return option. makeValue ( from: valuePtr. pointee)
100100 }
101101
102- public func bind< A : SocketAddress > ( to address: A ) throws {
102+ public func bind( to address: some SocketAddress ) throws {
103103 var addr = address
104104 let result = withUnsafePointer ( to: & addr) {
105105 $0. withMemoryRebound ( to: sockaddr. self, capacity: 1 ) {
106- Socket . bind ( file. rawValue, $0, socklen_t ( MemoryLayout < A > . size) )
106+ Socket . bind ( file. rawValue, $0, address . size)
107107 }
108108 }
109109 guard result >= 0 else {
@@ -170,11 +170,11 @@ public struct Socket: Sendable, Hashable {
170170 return ( newFile, addr)
171171 }
172172
173- public func connect< A : SocketAddress > ( to address: A ) throws {
173+ public func connect( to address: some SocketAddress ) throws {
174174 var addr = address
175175 let result = withUnsafePointer ( to: & addr) {
176176 $0. withMemoryRebound ( to: sockaddr. self, capacity: 1 ) {
177- Socket . connect ( file. rawValue, $0, socklen_t ( MemoryLayout < A > . size) )
177+ Socket . connect ( file. rawValue, $0, address . size)
178178 }
179179 }
180180 guard result >= 0 || errno == EISCONN else {
You can’t perform that action at this time.
0 commit comments