[Live-devel] How can I get the senders source port when receiving rtp streams with liveMedia?

Christian Gerstner gerstner at graphics.cs.uni-sb.de
Tue Feb 14 16:55:43 PST 2006


Ross Finlayson wrote:

>> I need to know the source port of a rtp stream I'm receiving with
>> live555 Streaming Media.
>> Is there an easy way to query this port?
>> If yes how can I query it?
>
>
> First, get the 'groupsock' object associated with the "RTPSource":
>         Groupsock* gs = yourRTPSource->RTPgs();
>
> Then, get its socket number:
>         int socketNumber = gs->socketNum();
>
> Then, get the source port:
>         Port resultPort;
>         if (!getSourcePort(env, socketNumber, resultPort) {
>                 env << "Failed to get source port: "
>                     << env.getResultMsg() << "\n";
>         } else {
>                 portNumBits sourcePortNum = resultPort.num():
>                 // Note that this is in network order; call ntohs() to 
> get host order
>         }

I'm very sorry that my question was mistakable, but what I need to know 
is not the port I'm receiving rtp data on
but the port on the senders side I'm receiving rtp data from.
Can I query this port somehow too?

Christian


More information about the live-devel mailing list