Skip to content

Commit

Permalink
Update TCPSocket.swift
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhanatM authored Oct 6, 2022
1 parent cd39d55 commit c2bdffd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/TCPSocket.swift
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public final class TCPSocket {
let size = socklen_t(MemoryLayout<sockaddr_in6>.size)
// bind the address and port on socket
guard withUnsafePointer(to: &address, { pointer in
return pointer.withMemoryRebound(to: sockaddr.self, capacity: Int(size)) { pointer in
return pointer.withMemoryRebound(to: sockaddr.self, capacity: Int32(size)) { pointer in
return SystemLibrary.bind(fileDescriptor, pointer, size) >= 0
}
}) else {
Expand Down Expand Up @@ -162,7 +162,7 @@ public final class TCPSocket {
let size = socklen_t(MemoryLayout<sockaddr_in6>.size)
// connect to the host and port
let connectResult = withUnsafePointer(to: &address) { pointer in
return pointer.withMemoryRebound(to: sockaddr.self, capacity: Int32(size)) { pointer in
return pointer.withMemoryRebound(to: sockaddr.self, capacity: Int(size)) { pointer in
return SystemLibrary.connect(fileDescriptor, pointer, size)
}
}
Expand Down

0 comments on commit c2bdffd

Please sign in to comment.