|
OPAL
Version 3.14.3
|
#include <transports.h>


Public Member Functions | |
Construction | |
| OpalListenerUDP (OpalEndPoint &endpoint, PIPSocket::Address binding=PIPSocket::GetDefaultIpAny(), WORD port=0, PBoolean exclusive=true) | |
| OpalListenerUDP (OpalEndPoint &endpoint, const OpalTransportAddress &binding, OpalTransportAddress::BindOptions option) | |
| ~OpalListenerUDP () | |
Overrides from OpalListener | |
| virtual bool | Open (const AcceptHandler &acceptHandler, ThreadMode mode=SpawnNewThreadMode) |
| virtual bool | IsOpen () const |
| 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 |
Member access | |
| void | SetBufferSize (PINDEX size) |
Public Member Functions inherited from OpalListenerIP | |
| OpalListenerIP (OpalEndPoint &endpoint, PIPSocket::Address binding=PIPSocket::GetDefaultIpAny(), WORD port=0, PBoolean exclusive=true) | |
| OpalListenerIP (OpalEndPoint &endpoint, const OpalTransportAddress &binding, OpalTransportAddress::BindOptions option) | |
| WORD | GetListenerPort () const |
Public Member Functions inherited from OpalListener | |
| OpalListener (OpalEndPoint &endpoint) | |
| void | PrintOn (ostream &strm) const |
| void | CloseWait () |
| void | CleanUpOnTermination () |
Protected Member Functions | |
| virtual const PCaselessString & | GetProtoPrefix () const |
Protected Member Functions inherited from OpalListenerIP | |
| bool | CanCreateTransport (const OpalTransportAddress &localAddress, const OpalTransportAddress &remoteAddress) const |
Protected Member Functions inherited from OpalListener | |
| void | ListenForConnections () |
| void | TransportThreadMain (OpalTransportPtr transport) |
Protected Attributes | |
| PMonitoredSocketsPtr | m_listenerBundle |
| PINDEX | m_bufferSize |
Protected Attributes inherited from OpalListenerIP | |
| PIPSocketAddressAndPort | m_binding |
| bool | m_exclusiveListener |
Protected Attributes inherited from OpalListener | |
| OpalEndPoint & | m_endpoint |
| PThread * | m_thread |
| AcceptHandler | m_acceptHandler |
| ThreadMode | m_threadMode |
Additional Inherited Members | |
Public Types inherited from OpalListener | |
| enum | ThreadMode { SpawnNewThreadMode, HandOffThreadMode, SingleThreadMode } |
| typedef PNotifierTemplate < const OpalTransportPtr & > | AcceptHandler |
| OpalListenerUDP::OpalListenerUDP | ( | OpalEndPoint & | endpoint, |
| PIPSocket::Address | binding = PIPSocket::GetDefaultIpAny(), |
||
| WORD | port = 0, |
||
| PBoolean | exclusive = true |
||
| ) |
Create a new listener.
| endpoint | Endpoint listener is used for |
| binding | Local interface to listen on |
| port | TCP port to listen for connections |
| exclusive | Exclusive listening mode, no other process can accept on the port |
| OpalListenerUDP::OpalListenerUDP | ( | OpalEndPoint & | endpoint, |
| const OpalTransportAddress & | binding, | ||
| OpalTransportAddress::BindOptions | option | ||
| ) |
| endpoint | Endpoint listener is used for |
| binding | Local interface to listen on |
| option | OPtions for binding |
| OpalListenerUDP::~OpalListenerUDP | ( | ) |
Destroy the listener thread.
|
virtual |
Accept a new incoming transport.
| timeout | Time to wait for incoming connection |
Implements OpalListener.
|
virtual |
Stop the listener thread and no longer accept incoming connections.
Implements OpalListener.
|
virtual |
Create a transport compatible with this listener.
Implements OpalListener.
|
virtual |
Get the local transport address on which this listener may be accessed. If remoteAddress is present and is an address that requires NAT for connectivity, then the returned address is adjusted to return the external address and port.
Reimplemented from OpalListenerIP.
|
protectedvirtual |
Implements OpalListenerIP.
|
virtual |
Indicate if the listener is open.
Implements OpalListener.
|
virtual |
Open the listener. Listen for an incoming connection and create a OpalTransport of the appropriate subclass.
If notifier function acceptHandler is non-NULL a thread is spawned to listen for incoming connections. The acceptHandler is called when a new connection is created. The INT parameter to the acceptHandler is a pointer to the new OpalTransport instance created by the listener.
If singleThread is false the acceptHandler function is called in the context of a new thread and the continues to listen for more connections. If true, then the acceptHandler function is called from within the listener threads context and no more connections are created. That is only a single connection is ever created by this listener.
If acceptHandler is NULL, then no thread is started and it is assumed that the caller is responsible for calling Accept() and waiting for the new connection.
| acceptHandler | Handler function for new connections |
| mode | How handler function is called thread wise |
Reimplemented from OpalListener.
|
inline |
Set the size of UDP packet reads.
References m_bufferSize.
|
protected |
Referenced by SetBufferSize().
|
protected |