I need to create a UDP listener without using bind() as other applications also listen to the port on the same device.
The following code works but uses bind(). I've searched for days and just can't find the answer.
I know this can be done but I just don't know how to do it.
Please give my some idea how to solve this.
Thanks,
Gary
The following code works but uses bind(). I've searched for days and just can't find the answer.
I know this can be done but I just don't know how to do it.
Please give my some idea how to solve this.
Thanks,
Gary
import select, socket port = 50222 # where do you expect to get a msg? bufferSize = 1024 # whatever you need s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) s.bind(('',port)) s.setblocking(0) while True: result = select.select([s],[],[]) msg = result[0][0].recv(bufferSize) print (msg)