The C++ framework for developing highly scalable, high performance servers on Windows platforms.

IDatagramSocket Class Reference
[SocketsDatagram SocketsInterfacesProtected destructors on abstract base classes]

Inheritance diagram for IDatagramSocket:
Collaboration diagram for IDatagramSocket:

List of all members.


Detailed Description

This interface adds datagram socket specific functionality to the IAsyncSocket interface. Note that instances of IDatagramSocket support a pseudo connected interface where you can issues Read() calls and RecvFrom() any address. IDatagramServerSocket presents a much more restricted interface intended for use from "pure" datagram servers.

Public Types

typedef char TimeToLive
typedef unsigned long DataLength
typedef unsigned short UserDataIndex
typedef unsigned long DataLength

Public Member Functions

virtual void RecvFrom ()=0
virtual void RecvFrom (JetByteTools::IO::IBuffer *pBuffer)=0
virtual void RecvFrom (JetByteTools::IO::CSmartBuffer &buffer)=0
virtual bool TryRecvFrom ()=0
virtual bool TryRecvFrom (JetByteTools::IO::IBuffer *pBuffer)=0
virtual bool TryRecvFrom (JetByteTools::IO::CSmartBuffer &buffer)=0
void SendTo (const IAddress &address, const char *pData, DataLength dataLength) override=0
void SendTo (const IAddress &address, const BYTE *pData, DataLength dataLength) override=0
void SendTo (const IAddress &address, JetByteTools::IO::CSmartBuffer &buffer) override=0
bool TrySendTo (const IAddress &address, const char *pData, DataLength dataLength) override=0
bool TrySendTo (const IAddress &address, const BYTE *pData, DataLength dataLength) override=0
bool TrySendTo (const IAddress &address, JetByteTools::IO::CSmartBuffer &buffer) override=0
virtual void Connect (const IAddress &address)=0
virtual bool Close ()=0
JetByteTools::Core::ILockableObjectGetLock () const override=0
 Returns the critical section that is used for locking this socket's data for multi-threaded use.
virtual CAddress GetLocalAddress () const =0
virtual CAddress GetRemoteAddress () const =0
virtual void AddRef ()=0
virtual void Release ()=0
virtual bool WeOwnOnlyReference () const =0
virtual void Shutdown ()=0
virtual void Shutdown (ShutdownHow how)=0
virtual bool AbortConnection ()=0
virtual bool AbortConnection (ConnectionClosureReason reason)=0
virtual
ConnectionDirection 
GetConnectionDirection () const =0
virtual void JoinMulticastGroup (const IAddress &groupAddress, const IAddress &interfaceAddress)=0
virtual void BlockMulticastGroupSource (const IAddress &groupAddress, const IAddress &interfaceAddress, const IAddress &sourceAddress)=0
virtual void UnblockMulticastGroupSource (const IAddress &groupAddress, const IAddress &interfaceAddress, const IAddress &sourceAddress)=0
virtual void LeaveMulticastGroup (const IAddress &groupAddress, const IAddress &interfaceAddress)=0
virtual void IncludeMulticastSource (const IAddress &groupAddress, const IAddress &interfaceAddress, const IAddress &sourceAddress)=0
virtual void ExcludeMulticastSource (const IAddress &groupAddress, const IAddress &interfaceAddress, const IAddress &sourceAddress)=0
virtual void SetMulticastSendInterface (const IAddress &interfaceAddress, TimeToLive multicastTTL=1, bool enableLoopback=false)=0
virtual void * GetUserPointer (UserDataIndex index) const =0
 Access the data stored at the specified index as a void pointer.
virtual void SetUserPointer (UserDataIndex index, void *pData)=0
 Update the data stored at the specified index as a void pointer.
virtual ULONG_PTR GetUserData (UserDataIndex index) const =0
 Access the data stored at the specified index as an unsigned long.
virtual void SetUserData (UserDataIndex index, ULONG_PTR data)=0
 Update the data stored at the specified index as an unsigned long.
virtual const
std::string & 
GetIdentifierA () const =0
virtual
JetByteTools::Core::_tstring 
GetIdentifier () const =0
virtual bool TryRead ()=0
 Attempts to read from the connection. Returns false if the connection is closed.
virtual bool TryRead (JetByteTools::IO::CSmartBuffer &buffer)=0
 Attempts to read from the connection. Returns false if the connection is closed. Note that this CAN throw an exception if the supplied buffer doesn't have any space left in it.
virtual bool TryRead (JetByteTools::IO::IBuffer *pBuffer)=0
 Attempts to read from the connection. Returns false if the connection is closed. Note that this CAN throw an exception if the supplied buffer doesn't have any space left in it.
virtual bool TryWrite (const char *pData, DataLength dataLength)=0
 Attempts to write to the connection. Returns false if the connection is closed.
virtual bool TryWrite (const BYTE *pData, DataLength dataLength)=0
 Attempts to write to the connection. Returns false if the connection is closed.
virtual bool TryWrite (JetByteTools::IO::CSmartBuffer &buffer)=0
 Attempts to write to the connection. Returns false if the connection is closed.
virtual bool TryWrite (JetByteTools::IO::IIterateableBufferChain &buffers)=0
 Attempts to write to the connection. Returns false if the connection is closed.
virtual void Shutdown ()=0
virtual void Shutdown (ShutdownHow how)=0
virtual bool AbortConnection ()=0
virtual bool AbortConnection (ConnectionClosureReason reason)=0
virtual CAddress GetLocalAddress () const =0
virtual CAddress GetRemoteAddress () const =0
virtual void AddRef ()=0
virtual void Release ()=0
virtual
ConnectionDirection 
GetConnectionDirection () const =0
virtual void Read ()=0
virtual void Read (CSmartBuffer &buffer)=0
virtual void Read (IBuffer *pBuffer)=0
virtual void Write (const char *pData, DataLength dataLength)=0
virtual void Write (const BYTE *pData, DataLength dataLength)=0
virtual void Write (CSmartBuffer &buffer)=0
virtual void Write (IIterateableBufferChain &buffers)=0
CSmartBuffer Allocate () override=0
 Allocate an instance of IBuffer, remember to call Release() on it when you're done with it.
virtual CSmartBuffer Allocate (IAllocateBuffer &allocator)=0
CSmartBuffer AllocateCustomSizedBuffer (IBuffer::BufferSize bufferSize) override=0
virtual CSmartBuffer AllocateCustomSizedBuffer (IAllocateBuffer &allocator, IBuffer::BufferSize bufferSize)=0
virtual void AddBufferToPool (IBuffer &buffer)=0

Static Public Attributes

static
JETBYTE_CONSTEXPR
UserDataIndex 
InvalidUserDataIndex = 0xFFFF

Protected Member Functions

virtual ~IDatagramSocket ()
 We never delete instances of this interface; you must manage the lifetime of the class that implements it.

Member Typedef Documentation

typedef unsigned long DataLength [inherited]

typedef unsigned long DataLength [inherited]


Constructor & Destructor Documentation

virtual ~IDatagramSocket (  )  [protected, virtual]

We never delete instances of this interface; you must manage the lifetime of the class that implements it.


Member Function Documentation

virtual void RecvFrom (  )  [pure virtual]

virtual void RecvFrom ( JetByteTools::IO::IBuffer *  pBuffer  )  [pure virtual]

virtual void RecvFrom ( JetByteTools::IO::CSmartBuffer buffer  )  [pure virtual]

virtual bool TryRecvFrom (  )  [pure virtual]

virtual bool TryRecvFrom ( JetByteTools::IO::IBuffer *  pBuffer  )  [pure virtual]

virtual bool TryRecvFrom ( JetByteTools::IO::CSmartBuffer buffer  )  [pure virtual]

void SendTo ( const IAddress address,
const char *  pData,
DataLength  dataLength 
) [override, pure virtual]

Implements IDatagramSendSocket.

void SendTo ( const IAddress address,
const BYTE pData,
DataLength  dataLength 
) [override, pure virtual]

Implements IDatagramSendSocket.

void SendTo ( const IAddress address,
JetByteTools::IO::CSmartBuffer buffer 
) [override, pure virtual]

Implements IDatagramSendSocket.

bool TrySendTo ( const IAddress address,
const char *  pData,
DataLength  dataLength 
) [override, pure virtual]

Implements IDatagramSendSocket.

bool TrySendTo ( const IAddress address,
const BYTE pData,
DataLength  dataLength 
) [override, pure virtual]

Implements IDatagramSendSocket.

bool TrySendTo ( const IAddress address,
JetByteTools::IO::CSmartBuffer buffer 
) [override, pure virtual]

Implements IDatagramSendSocket.

virtual void Connect ( const IAddress address  )  [pure virtual]

virtual bool Close (  )  [pure virtual]

virtual bool AbortConnection ( ConnectionClosureReason  reason  )  [pure virtual, inherited]

virtual void JoinMulticastGroup ( const IAddress groupAddress,
const IAddress interfaceAddress 
) [pure virtual, inherited]

virtual void BlockMulticastGroupSource ( const IAddress groupAddress,
const IAddress interfaceAddress,
const IAddress sourceAddress 
) [pure virtual, inherited]

virtual void UnblockMulticastGroupSource ( const IAddress groupAddress,
const IAddress interfaceAddress,
const IAddress sourceAddress 
) [pure virtual, inherited]

virtual void LeaveMulticastGroup ( const IAddress groupAddress,
const IAddress interfaceAddress 
) [pure virtual, inherited]

virtual void IncludeMulticastSource ( const IAddress groupAddress,
const IAddress interfaceAddress,
const IAddress sourceAddress 
) [pure virtual, inherited]

virtual void ExcludeMulticastSource ( const IAddress groupAddress,
const IAddress interfaceAddress,
const IAddress sourceAddress 
) [pure virtual, inherited]

virtual void SetMulticastSendInterface ( const IAddress interfaceAddress,
TimeToLive  multicastTTL = 1,
bool  enableLoopback = false 
) [pure virtual, inherited]

virtual bool TryRead ( JetByteTools::IO::IBuffer *  pBuffer  )  [pure virtual, inherited]

virtual bool TryWrite ( const char *  pData,
DataLength  dataLength 
) [pure virtual, inherited]

Attempts to write to the connection. Returns false if the connection is closed.

virtual bool TryWrite ( const BYTE pData,
DataLength  dataLength 
) [pure virtual, inherited]

Attempts to write to the connection. Returns false if the connection is closed.

virtual bool AbortConnection ( ConnectionClosureReason  reason  )  [pure virtual, inherited]

virtual void Read ( IBuffer *  pBuffer  )  [pure virtual, inherited]

virtual void Write ( const char *  pData,
DataLength  dataLength 
) [pure virtual, inherited]

virtual void Write ( const BYTE pData,
DataLength  dataLength 
) [pure virtual, inherited]

CSmartBuffer AllocateCustomSizedBuffer ( IBuffer::BufferSize  bufferSize  )  [override, pure virtual, inherited]

Implements IAllocateBuffer.

Implemented in CNullBufferPool.

virtual CSmartBuffer AllocateCustomSizedBuffer ( IAllocateBuffer allocator,
IBuffer::BufferSize  bufferSize 
) [pure virtual, inherited]

Implemented in CNullBufferPool.

virtual void AddBufferToPool ( IBuffer &  buffer  )  [pure virtual, inherited]

Implemented in CNullBufferPool.


Member Data Documentation

JETBYTE_CONSTEXPR UserDataIndex InvalidUserDataIndex = 0xFFFF [static, inherited]


Generated on Sun Sep 12 19:10:19 2021 for The Server Framework - v7.4 by doxygen 1.5.3