I would like to listen on 2 different UDP port with the same server.
I use SocketServer lib for my server, and basicly it looks like that;
SocketServer.UDPServer((”, 7878),CLASSNAME)
I would like to listen on 7878 and 7879 with the same server and same file.
Is that possible? If yes how?
Sure you can, using threads. Here’s a server:
It creates a server to listen on 9999 and another to listen on 12345.
Here’s a sample client you can use for testing this:
Note: this was taken from the docs of the
SocketServermodule, and modified with threads.