How can I write some test code to listen to UDPServer incoming messages asynchronously?
Loop pseudocode:
state: waiting for message from a given port and address
state: message received
-hence-> read
-then-> wait for next message
I wrote this little code but it does not seem to respond to incoming messages. I am running a server on the same address and port which sends data out.
func testServer() {
let server = UDPServer(address: host, port: Int32(port))
while true {
let received = server.recv(4)
print(received)
}
}
Hello,
How can I write some test code to listen to UDPServer incoming messages asynchronously?
Loop pseudocode:
I wrote this little code but it does not seem to respond to incoming messages. I am running a server on the same address and port which sends data out.