Skip to content Skip to sidebar Skip to footer

How To Bind 2 Udp Sockets To Same Port, One For Receiving And Other For Sending

I am working on a RTP streaming code on Android, where I need to receive RTP (UDP) packets on a port (say 5678) and send RTP packets from the same port (5678). Sender code and Rece

Solution 1:

You don't need to bind two sockets on the same port. Android DatagramSocket is bidrectional socket. Simply create one socket and use its receive and send methods. You can use them from different threads (receive and send) if that's an issue.


Post a Comment for "How To Bind 2 Udp Sockets To Same Port, One For Receiving And Other For Sending"