< Previous by Date Date Index Next by Date >
  Thread Index Next in Thread >

[reSIProcate-users] libreTurn: createAllocation() failed for TCP transport


Hello,

I want to test TCP transport between my board to an external TURN server (a reSIProcate's reTurnServer running on a Linux box).  In reTurn/client/test/TestAsyncClient.cxx, the default is UDP. I did the following changes:

1. I enabled TCP socket:
    boost::shared_ptr<TurnAsyncSocket> turnSocket(new TurnAsyncTcpSocket(ioService, &handler, asio::ip::address::from_string(address.c_str()), 0));

2. Then I changed the default transport from UDP to TCP in createAllocation( ). 

   virtual void onBindSuccess(unsigned int socketDesc, const StunTuple& reflexiveTuple, const StunTuple& stunServerTuple)
   {
      InfoLog( << "MyTurnAsyncSocketHandler::onBindingSuccess: socketDest=" << socketDesc << ", reflexive=" << reflexiveTuple << ", serverTuple=" << stunServerTuple);

      mTurnAsyncSocket->createAllocation(30,       // TurnAsyncSocket::UnspecifiedLifetime, 
                                         TurnAsyncSocket::UnspecifiedBandwidth, 
                                         StunMessage::PropsPortPair,
                                         TurnAsyncSocket::UnspecifiedToken,
                                         StunTuple::TCP);  <<== change to TCP
   }

However, I always got onAllocationFailure message:
# TestAsyncClient 10.113.54.60 3478 192.168.1.61
INFO | 20001014-062005.456 |  | RESIP:DNS | 1075064832 | DnsUtil.cxx:233 | Local IP address for  is 169.254.6.91
INFO | 20001014-062005.461 |  | RESIP:TEST | 1075064832 | TestAsyncClient.cxx:291 | Using 192.168.1.61 as local IP address.
INFO | 20001014-062005.479 |  | RESIP:TEST | 1075064832 | TestAsyncClient.cxx:95 | MyTurnAsyncSocketHandler::onConnectSuccess: socketDest=6, address=10.113.54.60, port=3478
INFO | 20001014-062005.511 |  | RESIP:TEST | 1075064832 | TestAsyncClient.cxx:156 | MyTurnAsyncSocketHandler::onAllocationFailure: socketDest=6 error=442(asio.misc error).
^C

Any idea why? If I use StunTuple::UDP in createAllocation( ), then it works, but is that correct for TurnAsyncTcpSocket?


Tom