OPAL
Version 3.12.9
|
#include <transports.h>
Public Member Functions | |
Construction | |
OpalTransportTCP (OpalEndPoint &endpoint, PIPSocket::Address binding=PIPSocket::GetDefaultIpAny(), WORD port=0, PBoolean reuseAddr=false) | |
OpalTransportTCP (OpalEndPoint &endpoint, PChannel *socket) | |
~OpalTransportTCP () | |
Destroy the TCP channel. More... | |
Overides from class OpalTransport | |
virtual PBoolean | IsReliable () const |
virtual PBoolean | IsCompatibleTransport (const OpalTransportAddress &address) const |
virtual PBoolean | Connect () |
virtual PBoolean | ReadPDU (PBYTEArray &pdu) |
virtual PBoolean | WritePDU (const PBYTEArray &pdu) |
![]() | |
virtual OpalTransportAddress | GetLocalAddress (bool allowNAT=true) const |
virtual PBoolean | SetLocalAddress (const OpalTransportAddress &address) |
virtual OpalTransportAddress | GetRemoteAddress () const |
virtual PBoolean | SetRemoteAddress (const OpalTransportAddress &address) |
![]() | |
OpalEndPoint & | GetEndPoint () const |
bool | IsOpen () const |
bool | IsGood () const |
PChannel::Errors | GetErrorCode (PChannel::ErrorGroup group=PChannel::NumErrorGroups) const |
PString | GetErrorText (PChannel::ErrorGroup group=PChannel::NumErrorGroups) const |
int | GetErrorNumber (PChannel::ErrorGroup group=PChannel::NumErrorGroups) const |
void | SetReadTimeout (const PTimeInterval &t) |
PChannel * | GetChannel () const |
void | SetChannel (PChannel *chan) |
bool | IsIdle () const |
void | Reference () |
void | Dereference () |
void | PrintOn (ostream &strm) const |
virtual PBoolean | Write (const void *buf, PINDEX len) |
~OpalTransport () | |
virtual bool | IsAuthenticated (const PString &) const |
virtual PString | GetInterface () const |
virtual bool | SetInterface (const PString &iface) |
PBoolean | ConnectTo (const OpalTransportAddress &address) |
virtual PBoolean | Close () |
void | CloseWait () |
void | CleanUpOnTermination () |
virtual void | SetPromiscuous (PromisciousModes promiscuous) |
virtual OpalTransportAddress | GetLastReceivedAddress () const |
virtual PString | GetLastReceivedInterface () const |
virtual bool | WriteConnect (const WriteConnectCallback &function) |
void | SetKeepAlive (const PTimeInterval &timeout, const PBYTEArray &data) |
virtual void | AttachThread (PThread *thread) |
virtual PBoolean | IsRunning () const |
Protected Member Functions | |
virtual const PCaselessString & | GetProtoPrefix () const |
bool | OnConnectedSocket (PTCPSocket *socket) |
![]() | |
OpalTransportIP (OpalEndPoint &endpoint, PChannel *channel, PIPSocket::Address binding, WORD port) | |
![]() | |
PDECLARE_NOTIFIER (PTimer, OpalTransport, KeepAlive) | |
OpalTransport (OpalEndPoint &endpoint, PChannel *channel) | |
Protected Attributes | |
PBoolean | reuseAddressFlag |
![]() | |
PIPSocket::Address | localAddress |
WORD | localPort |
PIPSocket::Address | remoteAddress |
WORD | remotePort |
![]() | |
OpalEndPoint & | endpoint |
PChannel * | m_channel |
PThread * | m_thread |
Thread handling the transport. More... | |
PTimer | m_keepAliveTimer |
PBYTEArray | m_keepAliveData |
PSimpleTimer | m_idleTimer |
PAtomicInteger | m_referenceCount |
Additional Inherited Members | |
![]() | |
enum | PromisciousModes { AcceptFromRemoteOnly, AcceptFromAnyAutoSet, AcceptFromAny, NumPromisciousModes } |
typedef PNotifierTemplate< bool & > | WriteConnectCallback |
OpalTransportTCP::OpalTransportTCP | ( | OpalEndPoint & | endpoint, |
PIPSocket::Address | binding = PIPSocket::GetDefaultIpAny() , |
||
WORD | port = 0 , |
||
PBoolean | reuseAddr = false |
||
) |
Create a new transport channel.
endpoint | Endpoint object |
binding | Local interface to use |
port | Local port to bind to |
reuseAddr | Flag for binding to already bound interface |
OpalTransportTCP::OpalTransportTCP | ( | OpalEndPoint & | endpoint, |
PChannel * | socket | ||
) |
endpoint | Endpoint object |
socket | Socket to use |
OpalTransportTCP::~OpalTransportTCP | ( | ) |
Destroy the TCP channel.
|
virtual |
Connect to the remote address.
Implements OpalTransport.
|
protectedvirtual |
Get the prefix for this transports protocol type.
Implements OpalTransportIP.
|
virtual |
Check that the transport address is compatible with transport.
Implements OpalTransport.
|
virtual |
Get indication of the type of underlying transport.
Implements OpalTransport.
|
protected |
|
virtual |
Read a packet from the transport. This will read using the transports mechanism for PDU boundaries, for example UDP is a single Read() call, while for TCP there is a TPKT header that indicates the size of the PDU.
If false is returned but there is data returned in the packet
that indicates that the available buffer space was too small, e.g. an EMSGSIZE error was returned by recvfrom.
pdu | PDU read from transport |
Implements OpalTransport.
|
virtual |
Write a packet to the transport. This will write using the transports mechanism for PDU boundaries, for example UDP is a single Write() call, while for TCP there is a TPKT header that indicates the size of the PDU.
pdu | Packet to write |
Implements OpalTransport.
|
protected |