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

CDatagramSocketConnectionManagerCallback Class Reference
[Datagram SocketsConnection managersCallback eventsNull Objects]

Inheritance diagram for CDatagramSocketConnectionManagerCallback:
Collaboration diagram for CDatagramSocketConnectionManagerCallback:

List of all members.


Detailed Description

An object that implements the CDatagramSocketConnectionManager callback interface and does nothing. You can derive from this class and override just the functions that you need to.

Public Member Functions

void OnSocketCreated (SOCKET s) override
 Called just after a socket is created. Allows you to adjust socket options that aren't othewise accessible via the framework. Use with care.
void OnBindCompleted (IDatagramSocket &socket) override
 Called when a socket has been bound to a local address, such as after a Bind() call completes, or when a SendTo() has been issued for the first time, or when a Connect() has completed.
void OnPreOutgoingConnect (JetByteTools::Core::IIndexedOpaqueUserData &userData, const IAddress &address, const void *pUserData) override
 Called just before an outgoing connection is established, i.e. a 'client' connection. The userData is the user data associated with the socket that will attempt the connection. The address is the address that the socket will attempt to connect to and the pointer to user data is whatever was passed in as user data to the Connect(), ConnectNoThrow() or AsyncConnect() call. This is usually used to slot the pointer to user data into the sockets user data store before the connection is attempted; thus passing data from the connect call site to the connection establishment or failure callback and beyond.
void OnConnectionEstablished (IDatagramSocket &socket, const IAddress &address) override
 Called when a connection is established. The address is the address that the socket is connected to. This is where you are expected to issue your first Read() or Write() call on a connection, if you don't and don't increase the reference count of the socket in some other way then the socket will close automatically.
void OnOutgoingConnectionFailed (IDatagramSocket &socket, const IAddress &address, DWORD lastError) override
 Called when an outgoing async or sync no throw connection fails. The address is the address that we were attempting to connect to. Note that sync connections attempts that can throw exceptions do not result in this callback being called when they fail to connect.
void OnSocketReleased (JetByteTools::Core::IIndexedOpaqueUserData &userData) override
 Called when a connection is released back to the allocator. This is guarenteed to be the last event that happens on an active socket. The socket is dead at this point and you're passed the userData that was related to it so that you can perform some final cleanup if required.
void OnReadCompleted (IDatagramSocket &socket, JetByteTools::IO::CSmartBuffer &buffer) override
 Called when an asynchronous read completes. This is where you are given the data that has been received on the connection and where your business logic would usually be expected to start dealing with the data. You are generally expected to issue another Read() before this call completes, if you don't and don't increase the reference count of the socket in some other way then the socket will close automatically.
void OnReadCompletionError (IDatagramSocket &socket, JetByteTools::IO::CSmartBuffer &buffer, DWORD lastError) override
 Called when an asynchronous read completes with an error.
void OnWriteCompleted (IDatagramSocket &socket, JetByteTools::IO::CSmartBuffer &buffer) override
 Called when an asynchronous write completes. There's not a great deal that needs to be done here.
void OnWriteCompletionError (IDatagramSocket &socket, JetByteTools::IO::CSmartBuffer &buffer, DWORD lastError) override
 Called when an asynchronous write completes with an error. In certain low resource situations you may find that the write can complete and not all of the data has been sent, but there's probably not a great deal that you can do to fix things...
void OnRecvFromCompleted (IDatagramSocket &socket, const IAddress &address, JetByteTools::IO::CSmartBuffer &buffer) override
 Called when an asynchronous recv from completes. This is where you are given the data that has been received on the connection and where your business logic would usually be expected to start dealing with the data. You are generally expected to issue another Read() before this call completes, if you don't and don't increase the reference count of the socket in some other way then the socket will close automatically.
void OnRecvFromCompletionError (IDatagramSocket &socket, const IAddress &address, JetByteTools::IO::CSmartBuffer &buffer, DWORD lastError) override
 Called when an asynchronous recv from completes with an error.
void OnSendToCompleted (IDatagramSocket &socket, const IAddress &address, JetByteTools::IO::CSmartBuffer &buffer) override
 Called when an asynchronous send to completes. There's not a great deal that needs to be done here.
void OnSendToCompletionError (IDatagramSocket &socket, const IAddress &address, JetByteTools::IO::CSmartBuffer &buffer, DWORD lastError) override
 Called when an asynchronous send to completes with an error. In certain low resource situations you may find that the send to can complete and not all of the data has been sent, but there's probably not a great deal that you can do to fix things...
void OnMaximumConnections () override
 Called when the maximum allowed number of connections is reached and no more new connections will be accepted by the server. See ILimitConnections for details on limiting connections.
void OnAllConnectionsAborted (DWORD numberOfConnectionsAborted) override
 Called when connections have been aborted due to AbortAllConnections() being called either explicitly, or implicitly as part of a shutdown sequence.
void OnShutdownInitiated () override
 Called when the connection manager starts to shutdown.
void OnShutdownComplete () override
 Called when the connection manager has finished its shutdown process and all active connections have been released.
void OnConnectionReset (IDatagramSocket &socket, DWORD lastError) override
 Called when the connection is reset.
void OnConnectionClosure (IDatagramSocket &socket, ConnectionClosureReason reason) override
 Called when the connection is closed.
void OnConnectionClosed (IDatagramSocket &socket) override
 Called when the connection is closed. You will get both an OnConnectionClosure() callback with a closure reason and then an OnConnectionClosed() without a reason. OnConnectionClosed() MAY be removed in a future release of the framework.
void OnError (const JetByteTools::Core::_tstring &message) override
 Called when there is an error which is not related to a particular connection (such as an exception thrown whilst handling an I/O operation or something...). Not a lot you can do except log the error message... Possibly shouldn't be exposed to client code?
void OnError (const JetByteTools::Core::_tstring &message, DWORD lastError) override

Member Function Documentation

void OnSocketCreated ( SOCKET  s  )  [override, virtual]

Called just after a socket is created. Allows you to adjust socket options that aren't othewise accessible via the framework. Use with care.

Implements IDatagramSocketConnectionManagerCallback.

void OnBindCompleted ( IDatagramSocket socket  )  [override, virtual]

Called when a socket has been bound to a local address, such as after a Bind() call completes, or when a SendTo() has been issued for the first time, or when a Connect() has completed.

Implements IDatagramSocketConnectionManagerCallback.

void OnPreOutgoingConnect ( JetByteTools::Core::IIndexedOpaqueUserData userData,
const IAddress address,
const void *  pUserData 
) [override, virtual]

Called just before an outgoing connection is established, i.e. a 'client' connection. The userData is the user data associated with the socket that will attempt the connection. The address is the address that the socket will attempt to connect to and the pointer to user data is whatever was passed in as user data to the Connect(), ConnectNoThrow() or AsyncConnect() call. This is usually used to slot the pointer to user data into the sockets user data store before the connection is attempted; thus passing data from the connect call site to the connection establishment or failure callback and beyond.

Implements IDatagramSocketConnectionManagerCallback.

void OnConnectionEstablished ( IDatagramSocket socket,
const IAddress address 
) [override, virtual]

Called when a connection is established. The address is the address that the socket is connected to. This is where you are expected to issue your first Read() or Write() call on a connection, if you don't and don't increase the reference count of the socket in some other way then the socket will close automatically.

Implements IDatagramSocketConnectionManagerCallback.

void OnOutgoingConnectionFailed ( IDatagramSocket socket,
const IAddress address,
DWORD  lastError 
) [override, virtual]

Called when an outgoing async or sync no throw connection fails. The address is the address that we were attempting to connect to. Note that sync connections attempts that can throw exceptions do not result in this callback being called when they fail to connect.

Implements IDatagramSocketConnectionManagerCallback.

void OnSocketReleased ( JetByteTools::Core::IIndexedOpaqueUserData userData  )  [override, virtual]

Called when a connection is released back to the allocator. This is guarenteed to be the last event that happens on an active socket. The socket is dead at this point and you're passed the userData that was related to it so that you can perform some final cleanup if required.

Implements IDatagramSocketConnectionManagerCallback.

void OnReadCompleted ( IDatagramSocket socket,
JetByteTools::IO::CSmartBuffer buffer 
) [override, virtual]

Called when an asynchronous read completes. This is where you are given the data that has been received on the connection and where your business logic would usually be expected to start dealing with the data. You are generally expected to issue another Read() before this call completes, if you don't and don't increase the reference count of the socket in some other way then the socket will close automatically.

Implements IDatagramSocketConnectionManagerCallback.

Reimplemented in CUDPConnectionCreator.

void OnReadCompletionError ( IDatagramSocket socket,
JetByteTools::IO::CSmartBuffer buffer,
DWORD  lastError 
) [override, virtual]

Called when an asynchronous read completes with an error.

Implements IDatagramSocketConnectionManagerCallback.

Reimplemented in CUDPConnectionCreator.

void OnWriteCompleted ( IDatagramSocket socket,
JetByteTools::IO::CSmartBuffer buffer 
) [override, virtual]

Called when an asynchronous write completes. There's not a great deal that needs to be done here.

Implements IDatagramSocketConnectionManagerCallback.

void OnWriteCompletionError ( IDatagramSocket socket,
JetByteTools::IO::CSmartBuffer buffer,
DWORD  lastError 
) [override, virtual]

Called when an asynchronous write completes with an error. In certain low resource situations you may find that the write can complete and not all of the data has been sent, but there's probably not a great deal that you can do to fix things...

Implements IDatagramSocketConnectionManagerCallback.

void OnRecvFromCompleted ( IDatagramSocket socket,
const IAddress address,
JetByteTools::IO::CSmartBuffer buffer 
) [override, virtual]

Called when an asynchronous recv from completes. This is where you are given the data that has been received on the connection and where your business logic would usually be expected to start dealing with the data. You are generally expected to issue another Read() before this call completes, if you don't and don't increase the reference count of the socket in some other way then the socket will close automatically.

Implements IDatagramSocketConnectionManagerCallback.

void OnRecvFromCompletionError ( IDatagramSocket socket,
const IAddress address,
JetByteTools::IO::CSmartBuffer buffer,
DWORD  lastError 
) [override, virtual]

Called when an asynchronous recv from completes with an error.

Implements IDatagramSocketConnectionManagerCallback.

void OnSendToCompleted ( IDatagramSocket socket,
const IAddress address,
JetByteTools::IO::CSmartBuffer buffer 
) [override, virtual]

Called when an asynchronous send to completes. There's not a great deal that needs to be done here.

Implements IDatagramSocketConnectionManagerCallback.

void OnSendToCompletionError ( IDatagramSocket socket,
const IAddress address,
JetByteTools::IO::CSmartBuffer buffer,
DWORD  lastError 
) [override, virtual]

Called when an asynchronous send to completes with an error. In certain low resource situations you may find that the send to can complete and not all of the data has been sent, but there's probably not a great deal that you can do to fix things...

Implements IDatagramSocketConnectionManagerCallback.

void OnMaximumConnections (  )  [override, virtual]

Called when the maximum allowed number of connections is reached and no more new connections will be accepted by the server. See ILimitConnections for details on limiting connections.

Implements IDatagramSocketConnectionManagerCallback.

void OnAllConnectionsAborted ( DWORD  numberOfConnectionsAborted  )  [override, virtual]

Called when connections have been aborted due to AbortAllConnections() being called either explicitly, or implicitly as part of a shutdown sequence.

Implements IDatagramSocketConnectionManagerCallback.

void OnShutdownInitiated (  )  [override, virtual]

Called when the connection manager starts to shutdown.

Implements IDatagramSocketConnectionManagerCallback.

void OnShutdownComplete (  )  [override, virtual]

Called when the connection manager has finished its shutdown process and all active connections have been released.

Implements IDatagramSocketConnectionManagerCallback.

void OnConnectionReset ( IDatagramSocket socket,
DWORD  lastError 
) [override, virtual]

Called when the connection is reset.

Implements IDatagramSocketCallback.

void OnConnectionClosure ( IDatagramSocket socket,
ConnectionClosureReason  reason 
) [override, virtual]

Called when the connection is closed.

Implements IDatagramSocketCallback.

Reimplemented in CUDPConnectionCreator.

void OnConnectionClosed ( IDatagramSocket socket  )  [override, virtual]

Called when the connection is closed. You will get both an OnConnectionClosure() callback with a closure reason and then an OnConnectionClosed() without a reason. OnConnectionClosed() MAY be removed in a future release of the framework.

Implements IDatagramSocketCallback.

void OnError ( const JetByteTools::Core::_tstring message  )  [override, virtual]

Called when there is an error which is not related to a particular connection (such as an exception thrown whilst handling an I/O operation or something...). Not a lot you can do except log the error message... Possibly shouldn't be exposed to client code?

Implements ISocketCallback.

void OnError ( const JetByteTools::Core::_tstring message,
DWORD  lastError 
) [override, virtual]

Implements ISocketCallback.


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