4#if defined(BOOST_MSVC) && (BOOST_MSVC >= 1400) \
5 && (!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600) \
6 && !defined(ASIO_ENABLE_CANCELIO)
7#error You must define ASIO_ENABLE_CANCELIO in your build settings.
12#include <asio/ssl.hpp>
37 unsigned short port = 0);
41 virtual asio::error_code
connect(
const std::string& address,
unsigned short port) = 0;
77 asio::error_code
send(
const char* buffer,
unsigned int size);
78 asio::error_code
sendTo(
const asio::ip::address& address,
unsigned short port,
const char* buffer,
unsigned int size);
81 asio::error_code
receive(
char* buffer,
unsigned int& size,
unsigned int timeout, asio::ip::address* sourceAddress=0,
unsigned short*
sourcePort=0);
82 asio::error_code
receiveFrom(
const asio::ip::address& address,
unsigned short port,
char* buffer,
unsigned int& size,
unsigned int timeout);
85 virtual asio::error_code
rawWrite(
const char* buffer,
unsigned int size) = 0;
86 virtual asio::error_code
rawWrite(
const std::vector<asio::const_buffer>&
buffers) = 0;
87 virtual asio::error_code
rawRead(
unsigned int timeout,
unsigned int*
bytesRead, asio::ip::address* sourceAddress=0,
unsigned short*
sourcePort=0) = 0;
150 asio::error_code checkIfAllocationRefreshRequired();
151 asio::error_code checkIfChannelBindingRefreshRequired();
154 asio::error_code handleStunMessage(
StunMessage&
stunMessage,
char* buffer,
unsigned int& size, asio::ip::address* sourceAddress=0,
unsigned short*
sourcePort=0);
static const uint8_t PropsNone
virtual asio::error_code rawWrite(const std::vector< asio::const_buffer > &buffers)=0
void setSoftware(const char *software)
asio::error_code destroyAllocation()
virtual void cancelSocket()=0
void handleRawRead(const asio::error_code &errorCode, size_t bytesRead)
StunTuple & getReflexiveTuple()
StunTuple mReflexiveTuple
asio::io_context mIOService
asio::steady_timer mReadTimer
asio::error_code receive(char *buffer, unsigned int &size, unsigned int timeout, asio::ip::address *sourceAddress=0, unsigned short *sourcePort=0)
static unsigned int UnspecifiedBandwidth
ChannelManager mChannelManager
static asio::ip::address UnspecifiedIpAddress
asio::error_code sendTo(const asio::ip::address &address, unsigned short port, const char *buffer, unsigned int size)
virtual asio::error_code rawWrite(const char *buffer, unsigned int size)=0
virtual asio::error_code connect(const std::string &address, unsigned short port)=0
asio::error_code receiveFrom(const asio::ip::address &address, unsigned short port, char *buffer, unsigned int &size, unsigned int timeout)
asio::error_code mReadErrorCode
asio::error_code clearActiveDestination()
virtual unsigned int getSocketDescriptor()=0
time_t mAllocationRefreshTime
ChannelBindingRefreshTimeMap mChannelBindingRefreshTimes
asio::error_code bindRequest()
unsigned int getLifetime()
asio::error_code requestSharedSecret(char *username, unsigned int usernameSize, char *password, unsigned int passwordSize)
unsigned char mRequestedProps
RemotePeer * mActiveDestination
void startReadTimer(unsigned int timeout)
void setUsernameAndPassword(const char *username, const char *password, bool shortTermAuth=false)
asio::error_code refreshAllocation()
virtual asio::error_code rawRead(unsigned int timeout, unsigned int *bytesRead, asio::ip::address *sourceAddress=0, unsigned short *sourcePort=0)=0
uint64_t mReservationToken
asio::error_code setActiveDestination(const asio::ip::address &address, unsigned short port)
static unsigned short UnspecifiedToken
unsigned int mRequestedLifetime
static const size_t MaxReceivedWhileWaiting
static unsigned int UnspecifiedLifetime
asio::error_code createAllocation(unsigned int lifetime=UnspecifiedLifetime, unsigned int bandwidth=UnspecifiedBandwidth, unsigned char requestedProps=StunMessage::PropsNone, uint64_t reservationToken=UnspecifiedToken, StunTuple::TransportType requestedTransportType=StunTuple::None)
StunTuple & getRelayTuple()
StunTuple mConnectedTuple
asio::error_code send(const char *buffer, unsigned int size)
unsigned int mRequestedBandwidth
unsigned int getBandwidth()
void handleRawReadTimeout(const asio::error_code &errorCode)
std::deque< std::vector< char > > mReceivedWhileWaiting
std::map< unsigned short, time_t > ChannelBindingRefreshTimeMap
StunTuple::TransportType mRequestedTransportType
void queueReceived(unsigned int size)
An alternative to std::string, encapsulates an arbitrary buffer of bytes.
std::recursive_mutex RecursiveMutex
unsigned __int64 uint64_t