[Live-devel] How to get other endpoint's IP address

Ben Rush ben at ben-rush.net
Mon Jun 13 20:10:55 PDT 2016


I'm creating an audio "client" using RTPSource. I have a custom
MediaSink-derived class which takes the traffic and routes it to my
computer's audio device. Works great.

What I'd like to do, however, is retrieve the sender's IP address (the IP
address of the sender which is sending traffic to the port/ip as specified
by my GroupSocks). How do I do this? I'm assuming from MyMediaSink?
Apologies, I looked through sample code but didn't see anything...

My client is built like this:

MyMediaSink* blah = MyMediaSink::createNew();
.....
.....
Groupsock rtpGroupSock(*environment, address, rtpPort, 1);
Groupsock rtcpGroupSock(*environment, address, rtcpPort, 1);
......
.....
RTPSource* rtpSource = SimpleRTPSource::createNew(
        *environment, &rtpGroupSock, payloadFormatCode,
        fSamplingFrequency, "audio/L16", 0, False /*no 'M' bit*/);
.....
.....
RTCPInstance* rtcpInstance =
        RTCPInstance::createNew(*environment, &rtcpGroupSock, 5000, CNAME,
NULL, rtpSource);
.....
.....
sink->startPlaying(*rtpSource, afterPlaying, NULL);
environment->taskScheduler().doEventLoop(); // does not return
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20160614/baf742ad/attachment.html>


More information about the live-devel mailing list