<div dir="ltr">I have adapted the testRTSPClient sample to receive a stream from my UDP source. Now I need to relay the data to another UDP address.<div><br></div><div>So I tried replacing the "DummySink" in testRTSPClient with the BasicUDPSink used in testRelay. It was almost a one-for-one replacement. But it doesn't work: it crashes the first time the datasink tries to write something to its output socket.</div><div><br></div><div>Should I be starting with a different sample, or can this be resolved?</div><div><br></div><div><div style="font-size:12.8px"><span style="color:rgb(68,68,68);font-family:arial,helvetica,sans-serif">Thanks</span></div><div style="font-size:12.8px"><span style="color:rgb(68,68,68);font-family:arial,helvetica,sans-serif;background-color:rgb(255,255,255)"><br></span></div><div style="font-size:12.8px"><span style="color:rgb(68,68,68);font-family:arial,helvetica,sans-serif;background-color:rgb(255,255,255)">Code:</span></div><div style="font-size:12.8px"><span style="color:rgb(68,68,68);font-family:arial,helvetica,sans-serif;background-color:rgb(255,255,255)">--------------------------------------------------------</span></div><div style="font-size:12.8px"><span style="color:rgb(68,68,68);font-family:arial,helvetica,sans-serif">I replaced this (from testRTSPClient)...</span></div><div style="font-size:12.8px"><span style="color:rgb(68,68,68);font-family:arial,helvetica,sans-serif"><br></span></div><div><div style="font-family:arial,helvetica,sans-serif;font-size:12.8px"><font color="#000000">void continueAfterSETUP(RTSPClient* rtspClient, int resultCode, char* resultString) {</font></div><div style="font-family:arial,helvetica,sans-serif;font-size:12.8px"><font color="#000000"> do {</font></div><div style="font-family:arial,helvetica,sans-serif;font-size:12.8px"><font color="#000000">...</font></div><div><div><font face="arial, helvetica, sans-serif" color="#000000"><span style="font-size:12.8px"> scs.subsession->sink = DummySink::createNew(env, *scs.subsession, rtspClient->url());</span></font></div></div><div style="font-family:arial,helvetica,sans-serif;font-size:12.8px"><font color="#000000">...</font></div></div><div style="font-family:arial,helvetica,sans-serif;font-size:12.8px"><font color="#000000">}</font></div><div style="color:rgb(68,68,68);font-family:arial,helvetica,sans-serif;font-size:12.8px"><br></div><div style="color:rgb(68,68,68);font-family:arial,helvetica,sans-serif;font-size:12.8px">with this...</div><div style="color:rgb(68,68,68);font-family:arial,helvetica,sans-serif;font-size:12.8px"><br></div><div><div style="font-family:arial,helvetica,sans-serif;font-size:12.8px"><font color="#000000">void continueAfterSETUP(RTSPClient* rtspClient, int resultCode, char* resultString) {</font></div><div style="font-family:arial,helvetica,sans-serif;font-size:12.8px"><font color="#000000"> do {</font></div><div style="font-family:arial,helvetica,sans-serif;font-size:12.8px"><font color="#000000">...</font></div><div><div style="font-family:arial,helvetica,sans-serif;font-size:12.8px"><font color="#000000"><span style="font-size:12.8px"> scs.subsession->sink = OurRelaySink::CreateNew(env, destinationAddress, 65535);</span><br></font></div><div style="font-family:arial,helvetica,sans-serif;font-size:12.8px"><font color="#000000">...</font></div><div style="font-family:arial,helvetica,sans-serif;font-size:12.8px"><font color="#000000">}</font></div><div style="color:rgb(68,68,68);font-family:arial,helvetica,sans-serif;font-size:12.8px"><br></div><div style="color:rgb(68,68,68);font-family:arial,helvetica,sans-serif;font-size:12.8px">where CreateNew is defined as</div><div style="color:rgb(68,68,68);font-family:arial,helvetica,sans-serif;font-size:12.8px"><br></div><div><div><font face="arial, helvetica, sans-serif" color="#000000"><span style="font-size:12.8px">OurRelaySink* OurRelaySink::CreateNew(UsageEnvironment& env, string& destUrl, unsigned packetSize)</span></font></div><div><font face="arial, helvetica, sans-serif" color="#000000"><span style="font-size:12.8px">{</span></font></div><div><font face="arial, helvetica, sans-serif" color="#000000"><span style="font-size:12.8px"> // Create a 'groupsock' for the destination address and port</span></font></div><div><font face="arial, helvetica, sans-serif" color="#000000"><span style="font-size:12.8px"> string scheme, host;</span></font></div><div><font face="arial, helvetica, sans-serif" color="#000000"><span style="font-size:12.8px"> unsigned nPort;</span></font></div><div><font face="arial, helvetica, sans-serif" color="#000000"><span style="font-size:12.8px"> if (CrackEndpoint(destUrl.c_str(), scheme, host, nPort))</span></font></div><div><font face="arial, helvetica, sans-serif" color="#000000"><span style="font-size:12.8px"> {</span></font></div><div><font face="arial, helvetica, sans-serif" color="#000000"><span style="font-size:12.8px"> struct in_addr outputAddress;</span></font></div><div><font face="arial, helvetica, sans-serif" color="#000000"><span style="font-size:12.8px"> outputAddress.s_addr = our_inet_addr(host.c_str());</span></font></div><div><font face="arial, helvetica, sans-serif" color="#000000"><span style="font-size:12.8px"> Port const outputPort(nPort);</span></font></div><div><font face="arial, helvetica, sans-serif" color="#000000"><span style="font-size:12.8px"> unsigned char const outputTTL = 255;</span></font></div><div><font face="arial, helvetica, sans-serif" color="#000000"><span style="font-size:12.8px"><br></span></font></div><div><font face="arial, helvetica, sans-serif" color="#000000"><span style="font-size:12.8px"> Groupsock outputGroupsock(env, outputAddress, outputPort, outputTTL);</span></font></div><div><font face="arial, helvetica, sans-serif" color="#000000"><span style="font-size:12.8px"><br></span></font></div><div><font face="arial, helvetica, sans-serif" color="#000000"><span style="font-size:12.8px"> return (OurRelaySink*)BasicUDPSink::createNew(env, &outputGroupsock, packetSize);</span></font></div><div><font face="arial, helvetica, sans-serif" color="#000000"><span style="font-size:12.8px"> }</span></font></div><div><font face="arial, helvetica, sans-serif" color="#000000"><span style="font-size:12.8px"> return NULL;</span></font></div><div><font face="arial, helvetica, sans-serif"><span style="font-size:12.8px"><font color="#000000">} </font><font color="#444444"> </font></span></font></div></div><div style="color:rgb(68,68,68);font-family:arial,helvetica,sans-serif;font-size:12.8px"><span style="color:rgb(102,102,102);font-family:verdana,sans-serif;font-size:12.8px">___________________________________________________</span><br></div></div></div><div><div class="gmail_signature"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div style="font-size:12.8px"><span style="color:rgb(68,68,68);font-family:arial,helvetica,sans-serif;font-weight:bold;font-size:12.8px">Mark Woodard</span><br></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><font face="arial, helvetica, sans-serif"><span style="color:rgb(102,102,102);font-weight:bold">Mutualink, Inc.</span></font></div><div style="font-size:12.8px"><font color="#666666" face="arial, helvetica, sans-serif">313 S Jupiter</font></div><div style="font-size:12.8px"><font face="arial, helvetica, sans-serif"><span style="color:rgb(102,102,102)">Allen, TX 75002</span></font></div><div style="font-size:12.8px"><font face="arial, helvetica, sans-serif"><br style="color:rgb(102,102,102)"></font></div><div style="font-size:12.8px"><font face="arial, helvetica, sans-serif"><span style="color:rgb(102,102,102)">Toll Free: <a href="tel:(866)%20957-5465" value="+18669575465" style="color:rgb(17,85,204)" target="_blank">(866) 957-5465</a> Ext: 508</span></font></div><div style="font-size:12.8px"><span style="color:black"><font face="arial, helvetica, sans-serif"><span style="color:rgb(102,102,102)">Direct: (972) 200-5020</span></font></span></div><div style="font-size:12.8px"><font color="#666666" style="font-family:arial,helvetica,sans-serif;font-size:12.8px">E-Mail: mwoodard</font><font color="#3d85c6" style="font-family:arial,helvetica,sans-serif;font-size:12.8px"><a href="mailto:employeer@mutualink.net" style="color:rgb(17,85,204)" target="_blank">@mutualink.net</a> </font><br></div><div style="font-size:12.8px"><font face="arial, helvetica, sans-serif"><br style="color:rgb(102,102,102)"></font></div><div style="font-size:12.8px"><div><font face="arial, helvetica, sans-serif"><span style="color:rgb(102,102,102)">Web: </span><font color="#3d85c6"><a href="http://www.mutualink.net/" style="color:rgb(17,85,204)" target="_blank">www.mutualink.net</a></font></font></div></div><div style="font-size:12.8px"><div dir="ltr" style="font-size:12.8px"><font size="2"><font face="arial, helvetica, sans-serif"><br style="color:rgb(102,102,102)"></font></font></div><div dir="ltr" style="font-size:12.8px"><i><font size="1" color="#cc0000"><b>Certified by the Department of Homeland Security SAFETY Act for Interoperable Communications</b></font></i><br><font color="#000000"><img src="https://www.google.com/a/mutualink.net/images/logo.gif?service=writely" border="0"></font><br><div dir="ltr" style="color:black"><div><font size="1" face="tahoma, sans-serif" style="color:rgb(102,102,102)">The information in this email, and subsequent attachments, may contain confidential information </font><span style="color:rgb(102,102,102);font-family:tahoma,sans-serif;font-size:x-small">that is </span><span style="color:rgb(102,102,102);font-family:tahoma,sans-serif;font-size:x-small">intended solely for the attention and use of the named addressee(s). This message or any </span><span style="color:rgb(102,102,102);font-family:tahoma,sans-serif;font-size:x-small">part thereof </span><span style="color:rgb(102,102,102);font-family:tahoma,sans-serif;font-size:x-small">must not be disclosed, copied, distributed or retained by any person without authorization from the addressee.</span></div><div><span style="color:rgb(102,102,102);font-family:tahoma,sans-serif;font-size:x-small"><br></span></div><div><span style="color:rgb(102,102,102);font-family:tahoma,sans-serif;font-size:x-small">Visit Mutualink at the following social media sites:</span></div><div><span style="color:rgb(102,102,102);font-family:tahoma,sans-serif;font-size:x-small"><br></span></div><div><span style="color:rgb(102,102,102);font-family:tahoma,sans-serif;font-size:x-small"><a href="http://www.twitter.com/MutualinkInc" style="color:rgb(17,85,204)" target="_blank"><img src="https://docs.google.com/a/mutualink.net/uc?id=0B-SuijPd065WVUhYWXIwZEMwS2c&export=download" alt=""></a> <a href="http://www.facebook.com/Mutualink" style="color:rgb(17,85,204)" target="_blank"><img src="https://docs.google.com/uc?export=download&id=0B-SuijPd065WMHo4UlhJcFFqSmc&revid=0B-SuijPd065WUHNvUHo1d0UyR1pSYktDWkpDS05FZmJBZ1BBPQ" alt=""></a> <a href="http://www.linkedin.com/company/mutualink" style="color:rgb(17,85,204)" target="_blank"><img src="https://docs.google.com/uc?export=download&id=0B-SuijPd065WdUhZYVZjamVMVTg&revid=0B-SuijPd065WTGhsbUx3NTVLMVBFSjV6eXJyckk5MzJaMW9zPQ"></a></span></div></div></div></div><div style="font-size:12.8px"><font face="arial, helvetica, sans-serif"><div dir="ltr" style="color:black"><font size="1" style="color:rgb(102,102,102)">The information in this email, and subsequent attachments, may contain confidential information that is </font><span style="color:rgb(102,102,102);font-size:x-small">intended solely for the attention and use of the named addressee(s). This message or any part thereof </span><span style="color:rgb(102,102,102);font-size:x-small">must not be disclosed, copied, distributed or retained by any person without authorization from the addressee.</span></div><div><span style="color:rgb(102,102,102);font-size:x-small"><br><br><br></span></div></font></div><div style="font-size:12.8px"><font face="arial, helvetica, sans-serif"></font></div></div></div></div></div></div>
</div></div>