swiftsocket / SwiftSocket

The easy way to use sockets on Apple platforms
BSD 3-Clause "New" or "Revised" License
1.68k stars 400 forks source link

Socket Timeout #181

Open lucky635 opened 5 years ago

lucky635 commented 5 years ago

we use this code. please tell how to timeout the socket public init(port: UInt16, handler: (( ipAddress: String, port: Int, _ response: [UInt8]) -> Void)?) { self.address = sockaddr_in( sin_len: __uint8_t(MemoryLayout.size), sin_family: sa_family_t(AF_INET), sin_port: UDPBroadcastConnection.htonsPort(port: port), sin_addr: INADDR_BROADCAST, sin_zero: ( 0, 0, 0, 0, 0, 0, 0, 0 ) )