10#define RESIPROCATE_SUBSYSTEM ReTurnSubsystem::RETURN
18 mTurnAllocation(turnAllocation),
64UdpRelayServer::onReceiveSuccess(
const asio::ip::address& address,
unsigned short port,
const std::shared_ptr<DataBuffer>& data)
72 DebugLog(<<
"Read " << (
int)data->size() <<
" bytes from udp relay socket (" << address.to_string() <<
":" << port <<
"): ");
89UdpRelayServer::onReceiveFailure(
const asio::error_code& e)
91 if(!mStopping && e != asio::error::operation_aborted && e != asio::error::bad_descriptor)
98UdpRelayServer::onSendSuccess()
103UdpRelayServer::onSendFailure(
const asio::error_code& error)
105 if(!mStopping && error != asio::error::operation_aborted)
107 if(mLastSendErrorCode == error)
113 mLastSendErrorCode = error;
#define WarningLog(args_)
asio::ip::udp::socket mSocket
asio::error_code bind(const asio::ip::address &address, unsigned short port) override
Note: The following API's are thread safe and queue the request to be handled by the ioService thread...
const asio::ip::address & getAddress() const
unsigned int getPort() const
const StunTuple & getRequestedTuple() const noexcept
void sendDataToClient(const StunTuple &peerAddress, const std::shared_ptr< DataBuffer > &data)
bool startReceiving()
Starts processing.
void stop()
Causes this object to destroy itself safely (ie. waiting for asynchronous callbacks to finish)
UdpRelayServer(asio::io_context &ioService, TurnAllocation &turnAllocation)
Create the server to listen on the specified UDP address and port.