transports.h
Go to the documentation of this file.
/*
* transport.h
*
* Transport declarations
*
* Open Phone Abstraction Library (OPAL)
* Formally known as the Open H323 project.
*
* Copyright (c) 2001 Equivalence Pty. Ltd.
* Portions Copyright (C) 2006 by Post Increment
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
* the License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Open Phone Abstraction Library.
*
* The Initial Developer of the Original Code is Equivalence Pty. Ltd.
*
* Contributor(s): Post Increment
* Portions of this code were written with the assistance of funding from
* US Joint Forces Command Joint Concept Development & Experimentation (J9)
* http://www.jfcom.mil/about/abt_j9.htm
*
* $Revision: 27884 $
* $Author: rjongbloed $
* $Date: 2012-06-24 19:43:04 -0500 (Sun, 24 Jun 2012) $
*/
#ifndef OPAL_OPAL_TRANSPORT_H
#define OPAL_OPAL_TRANSPORT_H
#ifdef P_USE_PRAGMA
#pragma interface
#endif
#include <opal/buildopts.h>
#include <ptlib/sockets.h>
#include <ptclib/psockbun.h>
class OpalManager;
class OpalEndPoint;
class OpalListener;
class OpalTransport;
class OpalInternalTransport;
class OpalTransportAddress : public PCaselessString
{
PCLASSINFO(OpalTransportAddress, PCaselessString);
public:
OpalTransportAddress();
OpalTransportAddress(
const char * address,
WORD port = 0,
const char * proto = NULL
);
OpalTransportAddress(
const PString & address,
WORD port = 0,
const char * proto = NULL
);
OpalTransportAddress(
const PIPSocket::Address & ip,
WORD port,
const char * proto = NULL
);
PBoolean IsEquivalent(
const OpalTransportAddress & address,
bool wildcards = false
) const;
PBoolean IsCompatible(
const OpalTransportAddress & address
) const;
PCaselessString GetProto(bool withDollar = false) const { return Left(Find('$')+(withDollar?1:0)); }
PBoolean GetIpAddress(PIPSocket::Address & ip) const;
PBoolean GetIpAndPort(PIPSocket::Address & ip, WORD & port) const;
PBoolean GetIpAndPort(PIPSocketAddressAndPort & ipPort) const;
virtual PString GetHostName(
bool includeService = false
) const;
enum BindOptions {
NoBinding,
HostOnly,
FullTSAP,
Streamed,
Datagram,
RouteInterface,
NumBindOptions
};
OpalListener * CreateListener(
OpalEndPoint & endpoint,
BindOptions option
) const;
virtual OpalTransport * CreateTransport(
OpalEndPoint & endpoint,
BindOptions option = HostOnly
) const;
protected:
void SetInternalTransport(
WORD port,
const char * proto
);
OpalInternalTransport * transport;
};
PDECLARE_ARRAY(OpalTransportAddressArray, OpalTransportAddress)
public:
OpalTransportAddressArray(
const OpalTransportAddress & address
) { AppendAddress(address); }
OpalTransportAddressArray(
const PStringArray & array
) { AppendStringCollection(array); }
OpalTransportAddressArray(
const PStringList & list
) { AppendStringCollection(list); }
OpalTransportAddressArray(
const PSortedStringList & list
) { AppendStringCollection(list); }
void AppendString(
const char * address
);
void AppendString(
const PString & address
);
void AppendAddress(
const OpalTransportAddress & address
);
protected:
void AppendStringCollection(
const PCollection & coll
);
};
class OpalListener : public PObject
{
PCLASSINFO(OpalListener, PObject);
public:
OpalListener(
OpalEndPoint & endpoint
);
void PrintOn(
ostream & strm
) const;
enum ThreadMode {
SpawnNewThreadMode,
HandOffThreadMode,
SingleThreadMode
};
virtual PBoolean Open(
const PNotifier & acceptHandler,
ThreadMode mode = SpawnNewThreadMode
) = 0;
virtual PBoolean IsOpen() = 0;
virtual void Close() = 0;
virtual OpalTransport * Accept(
const PTimeInterval & timeout
) = 0;
virtual OpalTransport * CreateTransport(
const OpalTransportAddress & localAddress,
const OpalTransportAddress & remoteAddress
) const = 0;
virtual OpalTransportAddress GetLocalAddress(
const OpalTransportAddress & remoteAddress = OpalTransportAddress()
) const = 0;
void CloseWait();
void CleanUpOnTermination() { CloseWait(); }
protected:
PDECLARE_NOTIFIER(PThread, OpalListener, ListenForConnections);
PBoolean StartThread(
const PNotifier & acceptHandler,
ThreadMode mode
);
OpalEndPoint & endpoint;
PThread * thread;
PNotifier acceptHandler;
ThreadMode threadMode;
};
PLIST(OpalListenerList, OpalListener);
class OpalListenerIP : public OpalListener
{
PCLASSINFO(OpalListenerIP, OpalListener);
public:
OpalListenerIP(
OpalEndPoint & endpoint,
PIPSocket::Address binding = PIPSocket::GetDefaultIpAny(),
WORD port = 0,
PBoolean exclusive = true
);
OpalListenerIP(
OpalEndPoint & endpoint,
const OpalTransportAddress & binding,
OpalTransportAddress::BindOptions option
);
virtual OpalTransportAddress GetLocalAddress(
const OpalTransportAddress & remoteAddress = OpalTransportAddress()
) const;
WORD GetListenerPort() const { return listenerPort; }
virtual const char * GetProtoPrefix() const = 0;
protected:
PIPSocket::Address localAddress;
WORD listenerPort;
PBoolean exclusiveListener;
};
class OpalListenerTCP : public OpalListenerIP
{
PCLASSINFO(OpalListenerTCP, OpalListenerIP);
public:
OpalListenerTCP(
OpalEndPoint & endpoint,
PIPSocket::Address binding = PIPSocket::GetDefaultIpAny(),
WORD port = 0,
PBoolean exclusive = true
);
OpalListenerTCP(
OpalEndPoint & endpoint,
const OpalTransportAddress & binding,
OpalTransportAddress::BindOptions option
);
~OpalListenerTCP();
virtual PBoolean Open(
const PNotifier & acceptHandler,
ThreadMode mode = SpawnNewThreadMode
);
virtual PBoolean IsOpen();
virtual void Close();
virtual OpalTransport * Accept(
const PTimeInterval & timeout
);
virtual OpalTransport * CreateTransport(
const OpalTransportAddress & localAddress,
const OpalTransportAddress & remoteAddress
) const;
protected:
virtual const char * GetProtoPrefix() const;
PTCPSocket listener;
};
class OpalListenerUDP : public OpalListenerIP
{
PCLASSINFO(OpalListenerUDP, OpalListenerIP);
public:
OpalListenerUDP(
OpalEndPoint & endpoint,
PIPSocket::Address binding = PIPSocket::GetDefaultIpAny(),
WORD port = 0,
PBoolean exclusive = true
);
OpalListenerUDP(
OpalEndPoint & endpoint,
const OpalTransportAddress & binding,
OpalTransportAddress::BindOptions option
);
~OpalListenerUDP();
virtual PBoolean Open(
const PNotifier & acceptHandler,
ThreadMode mode = SpawnNewThreadMode
);
virtual PBoolean IsOpen();
virtual void Close();
virtual OpalTransport * Accept(
const PTimeInterval & timeout
);
virtual OpalTransport * CreateTransport(
const OpalTransportAddress & localAddress,
const OpalTransportAddress & remoteAddress
) const;
virtual OpalTransportAddress GetLocalAddress(
const OpalTransportAddress & remoteAddress = OpalTransportAddress()
) const;
void SetBufferSize(
PINDEX size
) { m_bufferSize = size; }
protected:
virtual const char * GetProtoPrefix() const;
PMonitoredSocketsPtr listenerBundle;
PINDEX m_bufferSize;
};
class OpalTransport : public PIndirectChannel
{
PCLASSINFO(OpalTransport, PIndirectChannel);
public:
OpalTransport(OpalEndPoint & endpoint);
~OpalTransport();
void PrintOn(
ostream & strm
) const;
virtual PBoolean IsReliable() const = 0;
virtual PString GetInterface() const;
virtual bool SetInterface(
const PString & iface
);
virtual OpalTransportAddress GetLocalAddress(
bool allowNAT = true
) const = 0;
virtual PBoolean SetLocalAddress(
const OpalTransportAddress & address
) = 0;
virtual OpalTransportAddress GetRemoteAddress() const = 0;
virtual PBoolean SetRemoteAddress(
const OpalTransportAddress & address
) = 0;
virtual PBoolean Connect() = 0;
PBoolean ConnectTo(
const OpalTransportAddress & address
) { return SetRemoteAddress(address) && Connect(); }
virtual PBoolean Close();
void CloseWait();
void CleanUpOnTermination() { CloseWait(); }
virtual PBoolean IsCompatibleTransport(
const OpalTransportAddress & address
) const = 0;
enum PromisciousModes {
AcceptFromRemoteOnly,
AcceptFromAnyAutoSet,
AcceptFromAny,
NumPromisciousModes
};
virtual void SetPromiscuous(
PromisciousModes promiscuous
);
virtual OpalTransportAddress GetLastReceivedAddress() const;
virtual PString GetLastReceivedInterface() const;
virtual PBoolean ReadPDU(
PBYTEArray & packet
) = 0;
virtual PBoolean WritePDU(
const PBYTEArray & pdu
) = 0;
typedef PBoolean (*WriteConnectCallback)(OpalTransport & transport, void * userData);
virtual PBoolean WriteConnect(
WriteConnectCallback function,
void * userData
);
virtual void AttachThread(
PThread * thread
);
virtual PBoolean IsRunning() const;
OpalEndPoint & GetEndPoint() const { return endpoint; }
virtual const char * GetProtoPrefix() const = 0;
PMutex & GetWriteMutex() { return m_writeMutex; }
protected:
OpalEndPoint & endpoint;
PThread * thread;
PMutex m_writeMutex;
};
class OpalTransportIP : public OpalTransport
{
PCLASSINFO(OpalTransportIP, OpalTransport);
public:
OpalTransportIP(
OpalEndPoint & endpoint,
PIPSocket::Address binding,
WORD port
);
virtual OpalTransportAddress GetLocalAddress(
bool allowNAT = true
) const;
virtual PBoolean SetLocalAddress(
const OpalTransportAddress & address
);
virtual OpalTransportAddress GetRemoteAddress() const;
virtual PBoolean SetRemoteAddress(
const OpalTransportAddress & address
);
protected:
virtual const char * GetProtoPrefix() const = 0;
PIPSocket::Address localAddress; // Address of the local interface
WORD localPort;
PIPSocket::Address remoteAddress; // Address of the remote host
WORD remotePort;
};
class OpalTransportTCP : public OpalTransportIP
{
PCLASSINFO(OpalTransportTCP, OpalTransportIP);
public:
OpalTransportTCP(
OpalEndPoint & endpoint,
PIPSocket::Address binding = PIPSocket::GetDefaultIpAny(),
WORD port = 0,
PBoolean reuseAddr = false
);
OpalTransportTCP(
OpalEndPoint & endpoint,
PTCPSocket * socket
);
~OpalTransportTCP();
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
);
protected:
virtual const char * GetProtoPrefix() const;
virtual PBoolean OnOpen();
PBoolean reuseAddressFlag;
};
class OpalTransportUDP : public OpalTransportIP
{
PCLASSINFO(OpalTransportUDP, OpalTransportIP);
public:
OpalTransportUDP(
OpalEndPoint & endpoint,
PIPSocket::Address binding = PIPSocket::GetDefaultIpAny(),
WORD port = 0,
bool reuseAddr = false,
bool preOpen = false
);
OpalTransportUDP(
OpalEndPoint & endpoint,
const PMonitoredSocketsPtr & sockets,
const PString & iface
);
~OpalTransportUDP();
virtual PBoolean Read(
void * buffer,
PINDEX length
);
virtual PBoolean IsReliable() const;
virtual PBoolean IsCompatibleTransport(
const OpalTransportAddress & address
) const;
virtual PBoolean Connect();
virtual PString GetInterface() const;
virtual bool SetInterface(
const PString & iface
);
virtual OpalTransportAddress GetLocalAddress(
bool allowNAT = true
) const;
virtual PBoolean SetLocalAddress(
const OpalTransportAddress & address
);
virtual PBoolean SetRemoteAddress(
const OpalTransportAddress & address
);
virtual void SetPromiscuous(
PromisciousModes promiscuous
);
virtual OpalTransportAddress GetLastReceivedAddress() const;
virtual PString GetLastReceivedInterface() const;
virtual PBoolean ReadPDU(
PBYTEArray & packet
);
virtual PBoolean WritePDU(
const PBYTEArray & pdu
);
virtual PBoolean WriteConnect(
WriteConnectCallback function,
void * userData
);
void SetBufferSize(
PINDEX size
) { m_bufferSize = size; }
protected:
virtual const char * GetProtoPrefix() const;
OpalManager & manager;
PINDEX m_bufferSize;
PBYTEArray m_preReadPacket;
bool m_preReadOK;
friend class OpalListenerUDP;
};
class OpalInternalTransport : public PObject
{
PCLASSINFO(OpalInternalTransport, PObject);
public:
virtual PString GetHostName(
const OpalTransportAddress & address,
bool includeService
) const;
virtual PBoolean GetIpAndPort(
const OpalTransportAddress & address,
PIPSocket::Address & ip,
WORD & port
) const;
virtual OpalListener * CreateListener(
const OpalTransportAddress & address,
OpalEndPoint & endpoint,
OpalTransportAddress::BindOptions options
) const = 0;
virtual OpalTransport * CreateTransport(
const OpalTransportAddress & address,
OpalEndPoint & endpoint,
OpalTransportAddress::BindOptions options
) const = 0;
};
class OpalInternalIPTransport : public OpalInternalTransport
{
PCLASSINFO(OpalInternalIPTransport, OpalInternalTransport);
public:
virtual PString GetHostName(
const OpalTransportAddress & address,
bool includeService
) const;
virtual PBoolean GetIpAndPort(
const OpalTransportAddress & address,
PIPSocket::Address & ip,
WORD & port
) const;
static PBoolean GetAdjustedIpAndPort(const OpalTransportAddress & address,
OpalEndPoint & endpoint,
OpalTransportAddress::BindOptions option,
PIPSocket::Address & ip,
WORD & port,
PBoolean & reuseAddr);
};
template <class ListenerType, class TransportType, unsigned AltTypeOption, class AltTypeClass>
class OpalInternalIPTransportTemplate : public OpalInternalIPTransport
{
public:
OpalListener * CreateListener(
const OpalTransportAddress & address,
OpalEndPoint & endpoint,
OpalTransportAddress::BindOptions options
) const
{
return new ListenerType(endpoint, address, options);
}
OpalTransport * CreateTransport(
const OpalTransportAddress & address,
OpalEndPoint & endpoint,
OpalTransportAddress::BindOptions options
) const
{
PIPSocket::Address ip;
WORD port;
PBoolean reuseAddr;
if (GetAdjustedIpAndPort(address, endpoint, options, ip, port, reuseAddr)) {
if (options == AltTypeOption)
return new AltTypeClass(endpoint, ip, 0, reuseAddr);
else
return new TransportType(endpoint, ip, 0, reuseAddr);
}
return NULL;
}
};
typedef OpalInternalIPTransportTemplate<OpalListenerTCP, OpalTransportTCP, OpalTransportAddress::Datagram, OpalTransportUDP> OpalInternalTCPTransport;
typedef OpalInternalIPTransportTemplate<OpalListenerUDP, OpalTransportUDP, OpalTransportAddress::Streamed, OpalTransportTCP> OpalInternalUDPTransport;
#if OPAL_PTLIB_SSL
class PSSLContext;
class OpalListenerTCPS : public OpalListenerTCP
{
PCLASSINFO(OpalListenerTCPS, OpalListenerTCP);
public:
OpalListenerTCPS(
OpalEndPoint & endpoint,
PIPSocket::Address binding = PIPSocket::GetDefaultIpAny(),
WORD port = 0,
PBoolean exclusive = true
);
OpalListenerTCPS(
OpalEndPoint & endpoint,
const OpalTransportAddress & binding,
OpalTransportAddress::BindOptions option
);
~OpalListenerTCPS();
OpalTransport * Accept(const PTimeInterval & timeout);
const char * GetProtoPrefix() const;
protected:
void Construct();
PSSLContext * sslContext;
};
class OpalTransportTCPS : public OpalTransportTCP
{
PCLASSINFO(OpalTransportTCPS, OpalTransportTCP);
public:
OpalTransportTCPS(
OpalEndPoint & endpoint,
PIPSocket::Address binding = PIPSocket::GetDefaultIpAny(),
WORD port = 0,
PBoolean reuseAddr = false
);
OpalTransportTCPS(
OpalEndPoint & endpoint,
PTCPSocket * socket
);
~OpalTransportTCPS();
PBoolean IsCompatibleTransport(const OpalTransportAddress & address) const;
PBoolean Connect();
PBoolean OnOpen();
const char * GetProtoPrefix() const;
protected:
PSSLContext * sslContext;
};
typedef OpalInternalIPTransportTemplate<OpalListenerTCPS, OpalTransportTCPS, OpalTransportAddress::Datagram, OpalTransportUDP> OpalInternalTCPSTransport;
#endif // OPAL_PTLIB_SSL
#endif // OPAL_OPAL_TRANSPORT_H
// End of File ///////////////////////////////////////////////////////////////
OpalListenerUDP::GetProtoPrefix
virtual const char * GetProtoPrefix() const
OpalTransportIP::SetLocalAddress
virtual PBoolean SetLocalAddress(const OpalTransportAddress &address)
OpalTransportUDP::GetInterface
virtual PString GetInterface() const
OpalTransport::WriteConnect
virtual PBoolean WriteConnect(WriteConnectCallback function, void *userData)
OpalTransport::GetInterface
virtual PString GetInterface() const
OpalTransportIP
Definition: transports.h:908
OpalListenerIP::GetProtoPrefix
virtual const char * GetProtoPrefix() const =0
OpalManager
Definition: manager.h:74
OpalEndPoint
Definition: endpoint.h:67
OpalTransport::IsRunning
virtual PBoolean IsRunning() const
OpalListenerTCP::Close
virtual void Close()
OpalTransport::AttachThread
virtual void AttachThread(PThread *thread)
OpalListenerIP::localAddress
PIPSocket::Address localAddress
Definition: transports.h:508
OpalListener::HandOffThreadMode
Definition: transports.h:377
AppendAddress
void AppendAddress(const OpalTransportAddress &address)
OpalTransportUDP::~OpalTransportUDP
~OpalTransportUDP()
Destroy the UDP channel.
OpalTransportIP::OpalTransportIP
OpalTransportIP(OpalEndPoint &endpoint, PIPSocket::Address binding, WORD port)
OpalTransportUDP::GetLocalAddress
virtual OpalTransportAddress GetLocalAddress(bool allowNAT=true) const
OpalTransportTCP::OpalTransportTCP
OpalTransportTCP(OpalEndPoint &endpoint, PIPSocket::Address binding=PIPSocket::GetDefaultIpAny(), WORD port=0, PBoolean reuseAddr=false)
OpalListenerUDP::Accept
virtual OpalTransport * Accept(const PTimeInterval &timeout)
OpalInternalTCPTransport
OpalInternalIPTransportTemplate< OpalListenerTCP, OpalTransportTCP, OpalTransportAddress::Datagram, OpalTransportUDP > OpalInternalTCPTransport
Definition: transports.h:1316
OpalTransport::~OpalTransport
~OpalTransport()
OpalTransport::WritePDU
virtual PBoolean WritePDU(const PBYTEArray &pdu)=0
OpalListenerUDP::IsOpen
virtual PBoolean IsOpen()
OpalTransportIP::GetLocalAddress
virtual OpalTransportAddress GetLocalAddress(bool allowNAT=true) const
OpalInternalTransport::GetIpAndPort
virtual PBoolean GetIpAndPort(const OpalTransportAddress &address, PIPSocket::Address &ip, WORD &port) const
OpalListenerIP::GetLocalAddress
virtual OpalTransportAddress GetLocalAddress(const OpalTransportAddress &remoteAddress=OpalTransportAddress()) const
OpalListener::IsOpen
virtual PBoolean IsOpen()=0
buildopts.h
AppendStringCollection
void AppendStringCollection(const PCollection &coll)
OpalTransport::GetRemoteAddress
virtual OpalTransportAddress GetRemoteAddress() const =0
OpalListener::Accept
virtual OpalTransport * Accept(const PTimeInterval &timeout)=0
OpalTransport::endpoint
OpalEndPoint & endpoint
Definition: transports.h:902
OpalListenerTCP::Open
virtual PBoolean Open(const PNotifier &acceptHandler, ThreadMode mode=SpawnNewThreadMode)
OpalTransport::m_writeMutex
PMutex m_writeMutex
Definition: transports.h:904
OpalInternalTransport::CreateListener
virtual OpalListener * CreateListener(const OpalTransportAddress &address, OpalEndPoint &endpoint, OpalTransportAddress::BindOptions options) const =0
OpalInternalIPTransport::GetHostName
virtual PString GetHostName(const OpalTransportAddress &address, bool includeService) const
OpalInternalTransport::CreateTransport
virtual OpalTransport * CreateTransport(const OpalTransportAddress &address, OpalEndPoint &endpoint, OpalTransportAddress::BindOptions options) const =0
OpalTransportAddress::HostOnly
Definition: transports.h:215
OpalTransport::WriteConnectCallback
PBoolean(* WriteConnectCallback)(OpalTransport &transport, void *userData)
Definition: transports.h:863
OpalTransportUDP::m_preReadOK
bool m_preReadOK
Definition: transports.h:1223
OpalTransport
Definition: transports.h:703
OpalListenerTCP::~OpalListenerTCP
~OpalListenerTCP()
OpalInternalIPTransport::GetAdjustedIpAndPort
static PBoolean GetAdjustedIpAndPort(const OpalTransportAddress &address, OpalEndPoint &endpoint, OpalTransportAddress::BindOptions option, PIPSocket::Address &ip, WORD &port, PBoolean &reuseAddr)
OpalTransportAddress::GetProto
PCaselessString GetProto(bool withDollar=false) const
Definition: transports.h:193
OpalTransportUDP::Connect
virtual PBoolean Connect()
OpalListenerUDP::m_bufferSize
PINDEX m_bufferSize
Definition: transports.h:693
OpalTransport::AcceptFromRemoteOnly
Definition: transports.h:809
OpalListenerUDP::GetLocalAddress
virtual OpalTransportAddress GetLocalAddress(const OpalTransportAddress &remoteAddress=OpalTransportAddress()) const
OpalListenerIP::listenerPort
WORD listenerPort
Definition: transports.h:509
OpalListener::Open
virtual PBoolean Open(const PNotifier &acceptHandler, ThreadMode mode=SpawnNewThreadMode)=0
OpalListenerUDP::OpalListenerUDP
OpalListenerUDP(OpalEndPoint &endpoint, PIPSocket::Address binding=PIPSocket::GetDefaultIpAny(), WORD port=0, PBoolean exclusive=true)
OpalTransport::ConnectTo
PBoolean ConnectTo(const OpalTransportAddress &address)
Definition: transports.h:784
OpalListener::CloseWait
void CloseWait()
OpalTransportAddress::RouteInterface
Definition: transports.h:219
OpalTransport::OpalTransport
OpalTransport(OpalEndPoint &endpoint)
OpalTransportUDP::manager
OpalManager & manager
Definition: transports.h:1220
OpalListenerTCP::listener
PTCPSocket listener
Definition: transports.h:592
OpalListenerTCP::CreateTransport
virtual OpalTransport * CreateTransport(const OpalTransportAddress &localAddress, const OpalTransportAddress &remoteAddress) const
OpalListenerUDP
Definition: transports.h:596
OpalInternalIPTransportTemplate::CreateTransport
OpalTransport * CreateTransport(const OpalTransportAddress &address, OpalEndPoint &endpoint, OpalTransportAddress::BindOptions options) const
Definition: transports.h:1297
OpalTransportUDP::SetLocalAddress
virtual PBoolean SetLocalAddress(const OpalTransportAddress &address)
OpalTransportUDP::m_preReadPacket
PBYTEArray m_preReadPacket
Definition: transports.h:1222
OpalTransportUDP::WriteConnect
virtual PBoolean WriteConnect(WriteConnectCallback function, void *userData)
OpalListener::CreateTransport
virtual OpalTransport * CreateTransport(const OpalTransportAddress &localAddress, const OpalTransportAddress &remoteAddress) const =0
OpalTransport::GetWriteMutex
PMutex & GetWriteMutex()
Definition: transports.h:899
OpalListenerUDP::CreateTransport
virtual OpalTransport * CreateTransport(const OpalTransportAddress &localAddress, const OpalTransportAddress &remoteAddress) const
OpalTransportAddress::IsCompatible
PBoolean IsCompatible(const OpalTransportAddress &address) const
OpalTransport::PromisciousModes
PromisciousModes
Definition: transports.h:808
OpalTransportIP::localAddress
PIPSocket::Address localAddress
Definition: transports.h:959
OpalTransportTCP
Definition: transports.h:966
OpalTransportTCP::IsReliable
virtual PBoolean IsReliable() const
OpalListenerUDP::listenerBundle
PMonitoredSocketsPtr listenerBundle
Definition: transports.h:692
OpalTransportTCP::IsCompatibleTransport
virtual PBoolean IsCompatibleTransport(const OpalTransportAddress &address) const
OpalListener::acceptHandler
PNotifier acceptHandler
Definition: transports.h:458
OpalTransportAddress::FullTSAP
Definition: transports.h:216
OpalTransportUDP::GetLastReceivedInterface
virtual PString GetLastReceivedInterface() const
OpalInternalUDPTransport
OpalInternalIPTransportTemplate< OpalListenerUDP, OpalTransportUDP, OpalTransportAddress::Streamed, OpalTransportTCP > OpalInternalUDPTransport
Definition: transports.h:1317
OpalTransportAddress::Streamed
Definition: transports.h:217
OpalListener::PDECLARE_NOTIFIER
PDECLARE_NOTIFIER(PThread, OpalListener, ListenForConnections)
OpalTransportTCP::Connect
virtual PBoolean Connect()
OpalListener
Definition: transports.h:351
OpalListener::thread
PThread * thread
Definition: transports.h:457
OpalTransport::SetRemoteAddress
virtual PBoolean SetRemoteAddress(const OpalTransportAddress &address)=0
OpalTransportAddress::GetIpAddress
PBoolean GetIpAddress(PIPSocket::Address &ip) const
OpalTransportIP::remoteAddress
PIPSocket::Address remoteAddress
Definition: transports.h:961
OpalTransportAddress::GetIpAndPort
PBoolean GetIpAndPort(PIPSocket::Address &ip, WORD &port) const
OpalTransport::AcceptFromAny
Definition: transports.h:811
OpalTransport::IsReliable
virtual PBoolean IsReliable() const =0
OpalTransportAddress::Datagram
Definition: transports.h:218
OpalTransport::PrintOn
void PrintOn(ostream &strm) const
OpalTransport::CleanUpOnTermination
void CleanUpOnTermination()
Definition: transports.h:799
OpalTransportIP::SetRemoteAddress
virtual PBoolean SetRemoteAddress(const OpalTransportAddress &address)
OpalTransportAddress::NumBindOptions
Definition: transports.h:220
OpalListener::endpoint
OpalEndPoint & endpoint
Definition: transports.h:456
OpalTransport::AcceptFromAnyAutoSet
Definition: transports.h:810
OpalListenerTCP::Accept
virtual OpalTransport * Accept(const PTimeInterval &timeout)
OpalTransport::GetLastReceivedAddress
virtual OpalTransportAddress GetLastReceivedAddress() const
OpalTransportUDP::OpalTransportUDP
OpalTransportUDP(OpalEndPoint &endpoint, PIPSocket::Address binding=PIPSocket::GetDefaultIpAny(), WORD port=0, bool reuseAddr=false, bool preOpen=false)
OpalListenerIP::exclusiveListener
PBoolean exclusiveListener
Definition: transports.h:510
OpalListenerIP::OpalListenerIP
OpalListenerIP(OpalEndPoint &endpoint, PIPSocket::Address binding=PIPSocket::GetDefaultIpAny(), WORD port=0, PBoolean exclusive=true)
OpalTransport::Close
virtual PBoolean Close()
OpalTransportTCP::GetProtoPrefix
virtual const char * GetProtoPrefix() const
OpalTransportUDP::SetBufferSize
void SetBufferSize(PINDEX size)
Definition: transports.h:1210
OpalInternalIPTransport::GetIpAndPort
virtual PBoolean GetIpAndPort(const OpalTransportAddress &address, PIPSocket::Address &ip, WORD &port) const
OpalTransportAddress::GetHostName
virtual PString GetHostName(bool includeService=false) const
OpalTransportAddress::SetInternalTransport
void SetInternalTransport(WORD port, const char *proto)
OpalTransportUDP::ReadPDU
virtual PBoolean ReadPDU(PBYTEArray &packet)
OpalTransport::GetLocalAddress
virtual OpalTransportAddress GetLocalAddress(bool allowNAT=true) const =0
OpalListenerUDP::~OpalListenerUDP
~OpalListenerUDP()
OpalTransportAddress::CreateListener
OpalListener * CreateListener(OpalEndPoint &endpoint, BindOptions option) const
OpalListener::SingleThreadMode
Definition: transports.h:378
OpalTransportUDP::SetPromiscuous
virtual void SetPromiscuous(PromisciousModes promiscuous)
OpalListener::PrintOn
void PrintOn(ostream &strm) const
OpalListenerUDP::Close
virtual void Close()
OpalTransportTCP::OnOpen
virtual PBoolean OnOpen()
OpalInternalIPTransportTemplate
Definition: transports.h:1285
OpalTransport::CloseWait
void CloseWait()
OpalTransport::NumPromisciousModes
Definition: transports.h:812
PLIST
PLIST(OpalListenerList, OpalListener)
OpalTransportTCP::~OpalTransportTCP
~OpalTransportTCP()
Destroy the TCP channel.
OpalTransportTCP::WritePDU
virtual PBoolean WritePDU(const PBYTEArray &pdu)
OpalTransportUDP::SetInterface
virtual bool SetInterface(const PString &iface)
OpalInternalIPTransport
Definition: transports.h:1262
OpalTransportIP::localPort
WORD localPort
Definition: transports.h:960
OpalTransport::thread
PThread * thread
Thread handling the transport.
Definition: transports.h:903
OpalTransportUDP::IsCompatibleTransport
virtual PBoolean IsCompatibleTransport(const OpalTransportAddress &address) const
OpalTransportTCP::ReadPDU
virtual PBoolean ReadPDU(PBYTEArray &pdu)
OpalTransportUDP::GetProtoPrefix
virtual const char * GetProtoPrefix() const
OpalListenerIP
Definition: transports.h:466
OpalTransport::SetInterface
virtual bool SetInterface(const PString &iface)
OpalTransportUDP::GetLastReceivedAddress
virtual OpalTransportAddress GetLastReceivedAddress() const
OpalTransportAddressArray
OpalTransportAddressArray(const OpalTransportAddress &address)
Definition: transports.h:305
OpalTransportUDP::IsReliable
virtual PBoolean IsReliable() const
OpalInternalTransport::GetHostName
virtual PString GetHostName(const OpalTransportAddress &address, bool includeService) const
OpalListenerIP::GetListenerPort
WORD GetListenerPort() const
Definition: transports.h:501
OpalTransport::SetLocalAddress
virtual PBoolean SetLocalAddress(const OpalTransportAddress &address)=0
OpalTransportAddress::NoBinding
Definition: transports.h:214
OpalTransportUDP::SetRemoteAddress
virtual PBoolean SetRemoteAddress(const OpalTransportAddress &address)
OpalTransport::ReadPDU
virtual PBoolean ReadPDU(PBYTEArray &packet)=0
OpalListener::GetLocalAddress
virtual OpalTransportAddress GetLocalAddress(const OpalTransportAddress &remoteAddress=OpalTransportAddress()) const =0
OpalTransportTCP::reuseAddressFlag
PBoolean reuseAddressFlag
Definition: transports.h:1046
OpalListenerTCP::GetProtoPrefix
virtual const char * GetProtoPrefix() const
OpalTransportUDP::m_bufferSize
PINDEX m_bufferSize
Definition: transports.h:1221
OpalListener::SpawnNewThreadMode
Definition: transports.h:376
OpalListenerTCP
Definition: transports.h:514
OpalTransportAddress::CreateTransport
virtual OpalTransport * CreateTransport(OpalEndPoint &endpoint, BindOptions option=HostOnly) const
OpalTransportIP::remotePort
WORD remotePort
Definition: transports.h:962
OpalTransportAddress::BindOptions
BindOptions
Definition: transports.h:213
OpalTransportUDP::WritePDU
virtual PBoolean WritePDU(const PBYTEArray &pdu)
OpalTransportUDP
Definition: transports.h:1050
AppendString
void AppendString(const char *address)
OpalListener::threadMode
ThreadMode threadMode
Definition: transports.h:459
OpalTransportIP::GetRemoteAddress
virtual OpalTransportAddress GetRemoteAddress() const
OpalTransport::GetLastReceivedInterface
virtual PString GetLastReceivedInterface() const
OpalTransport::IsCompatibleTransport
virtual PBoolean IsCompatibleTransport(const OpalTransportAddress &address) const =0
Promiscious modes for transport.
OpalInternalIPTransportTemplate::CreateListener
OpalListener * CreateListener(const OpalTransportAddress &address, OpalEndPoint &endpoint, OpalTransportAddress::BindOptions options) const
Definition: transports.h:1288
OpalListener::Close
virtual void Close()=0
OpalListenerTCP::IsOpen
virtual PBoolean IsOpen()
OpalListener::StartThread
PBoolean StartThread(const PNotifier &acceptHandler, ThreadMode mode)
OpalTransportUDP::Read
virtual PBoolean Read(void *buffer, PINDEX length)
OpalInternalTransport
Definition: transports.h:1231
OpalListener::ThreadMode
ThreadMode
Definition: transports.h:375
OpalListener::CleanUpOnTermination
void CleanUpOnTermination()
Definition: transports.h:437
OpalTransport::GetProtoPrefix
virtual const char * GetProtoPrefix() const =0
OpalTransportIP::GetProtoPrefix
virtual const char * GetProtoPrefix() const =0
OpalTransport::GetEndPoint
OpalEndPoint & GetEndPoint() const
Definition: transports.h:893
OpalTransportAddress
Definition: transports.h:149
OpalTransportAddress::transport
OpalInternalTransport * transport
Definition: transports.h:299
OpalTransportAddress::IsEquivalent
PBoolean IsEquivalent(const OpalTransportAddress &address, bool wildcards=false) const
OpalListenerUDP::Open
virtual PBoolean Open(const PNotifier &acceptHandler, ThreadMode mode=SpawnNewThreadMode)
OpalTransport::SetPromiscuous
virtual void SetPromiscuous(PromisciousModes promiscuous)
OpalListenerUDP::SetBufferSize
void SetBufferSize(PINDEX size)
Definition: transports.h:683
OpalListener::OpalListener
OpalListener(OpalEndPoint &endpoint)
OpalTransportAddress::OpalTransportAddress
OpalTransportAddress()
OpalTransport::Connect
virtual PBoolean Connect()=0
OpalListenerTCP::OpalListenerTCP
OpalListenerTCP(OpalEndPoint &endpoint, PIPSocket::Address binding=PIPSocket::GetDefaultIpAny(), WORD port=0, PBoolean exclusive=true)