I tried to send an RTP Stream and receive it on the same computer, but it didn't work. I'm using the classes AVTransmit2 and AVReceive2 I have assumed these classes are popular so I haven't include the code for them) for this.
It works perfectly fine when the one computer is sending using AVTransmit2 and another receiving using AVReceive2. However, when on the same computer, I receive the following error in AVReceive2:
Cannot create the RTP Session: Unrecognized Windows Sockets error: 0: Cannot bind
The Address I have used for both transmitting and receiving is: 184.108.40.206/22200
And I also discovered that it IS possible to send and receive streams on the same computer using JMStudio, but I found it very hard to dissect its code.
How can this be achieved using those two classes i.e. AVTransmit2 and AVReceive2?
AVTransmit2, when it creates its send stream, it uses the destination port value as the send port value. There's no real reason to do so, so you can just change it to bind to an available source port rather than just reusing the destination port value.