Open lucky635 opened 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 ) )
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 )
)