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

IDatagramSocketServerCallback Class Reference
[Datagram SocketsSocket serversCallback eventsInterfacesProtected destructors on abstract base classes]

Inheritance diagram for IDatagramSocketServerCallback:
Collaboration diagram for IDatagramSocketServerCallback:

List of all members.


Detailed Description

The socket server callback interface is composed from more specific interfaces using inheritance. This is purely to allow the framework to work in terms of the narrowest interface internally and does not affect the user of the code. This is, effectively, the first interface that the user would wish to implement.

Public Member Functions

virtual void OnStartAcceptingConnections ()=0
 Called when the server starts accepting connections.
virtual void OnStopAcceptingConnections ()=0
 Called when the server stops accepting connections.
virtual void OnSocketCreated (SOCKET s)=0
 Called just after a socket is created. Allows you to adjust socket options that are not otherwise accessible via the framework. Use with care.
virtual void OnSocketReleased (JetByteTools::Core::IIndexedOpaqueUserData &userData)=0
 Called when a connection is released back to the allocator. This is guaranteed 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 OnConnectionReset (IDatagramServerSocket &socket, DWORD lastError) override=0
 Called when the connection is reset.
virtual void OnReadCompleted (IDatagramServerSocket &socket, JetByteTools::IO::CSmartBuffer &buffer)=0
 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.
virtual void OnReadCompletionError (IDatagramServerSocket &socket, JetByteTools::IO::CSmartBuffer &buffer, DWORD lastError)=0
 Called when an asynchronous read completes with an error.
virtual void OnWriteCompleted (IDatagramServerSocket &socket, JetByteTools::IO::CSmartBuffer &buffer)=0
 Called when an asynchronous write completes. There's not a great deal that needs to be done here.
virtual void OnWriteCompletionError (IDatagramServerSocket &socket, JetByteTools::IO::CSmartBuffer &buffer, DWORD lastError)=0
 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...
virtual void OnSendToCompleted (IDatagramServerSocket &socket, const IAddress &address, JetByteTools::IO::CSmartBuffer &buffer)=0
 Called when an asynchronous send to completes. There's not a great deal that needs to be done here.
virtual void OnSendToCompletionError (IDatagramServerSocket &socket, const IAddress &address, JetByteTools::IO::CSmartBuffer &buffer, DWORD lastError)=0
 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...
virtual void OnMaximumConnections ()=0
 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.
virtual void OnAllConnectionsAborted (DWORD numberOfConnectionsAborted)=0
 Called when connections have been aborted due to AbortAllConnections() being called either explicitly, or implicitly as part of a shutdown sequence.
virtual void OnShutdownInitiated ()=0
 Called when the server starts to shutdown.
virtual void OnShutdownComplete ()=0
 Called when the server has finished its shutdown process.
virtual void OnIncrementPendingReceives (DWORD pendingReceives)=0
 Called when the number of pending receives has increased. The value supplied is the new number of pending receives.
virtual void OnDecrementPendingReceives (DWORD pendingReceives)=0
 Called when the number of pending receives has decreased. The value supplied is the new number of pending receives.
virtual void OnConnectionClosure (IDatagramServerSocket &socket, ConnectionClosureReason reason)=0
 Called when the connection is closed.
virtual void OnConnectionClosed (IDatagramServerSocket &socket)=0
 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.
virtual void OnError (const JetByteTools::Core::_tstring &message)=0
 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?
virtual void OnError (const JetByteTools::Core::_tstring &message, DWORD lastError)=0

Protected Member Functions

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

Constructor & Destructor Documentation

virtual ~IDatagramSocketServerCallback (  )  [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 OnStartAcceptingConnections (  )  [pure virtual]

Called when the server starts accepting connections.

Implemented in CDatagramSocketServerCallback, and CDatagramSocketServerCallback.

virtual void OnStopAcceptingConnections (  )  [pure virtual]

Called when the server stops accepting connections.

Implemented in CDatagramSocketServerCallback, and CDatagramSocketServerCallback.

virtual void OnSocketCreated ( SOCKET  s  )  [pure virtual]

Called just after a socket is created. Allows you to adjust socket options that are not otherwise accessible via the framework. Use with care.

Implemented in CDatagramSocketServerCallback, and CDatagramSocketServerCallback.

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

Called when a connection is released back to the allocator. This is guaranteed 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.

Implemented in CDatagramSocketServerCallback, and CDatagramSocketServerCallback.

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

Called when the connection is reset.

Implements IDatagramServerSocketCallback.

Implemented in CDatagramSocketServerCallback, and CDatagramSocketServerCallback.

virtual void OnReadCompleted ( IDatagramServerSocket socket,
JetByteTools::IO::CSmartBuffer buffer 
) [pure 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.

Implemented in CDatagramSocketServerCallback, and CDatagramSocketServerCallback.

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

Called when an asynchronous read completes with an error.

Implemented in CDatagramSocketServerCallback, and CDatagramSocketServerCallback.

virtual void OnWriteCompleted ( IDatagramServerSocket socket,
JetByteTools::IO::CSmartBuffer buffer 
) [pure virtual]

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

Implemented in CDatagramSocketServerCallback, and CDatagramSocketServerCallback.

virtual void OnWriteCompletionError ( IDatagramServerSocket socket,
JetByteTools::IO::CSmartBuffer buffer,
DWORD  lastError 
) [pure 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...

Implemented in CDatagramSocketServerCallback, and CDatagramSocketServerCallback.

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

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

Implemented in CDatagramSocketServerCallback, and CDatagramSocketServerCallback.

virtual void OnSendToCompletionError ( IDatagramServerSocket socket,
const IAddress address,
JetByteTools::IO::CSmartBuffer buffer,
DWORD  lastError 
) [pure 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...

Implemented in CDatagramSocketServerCallback, and CDatagramSocketServerCallback.

virtual void OnMaximumConnections (  )  [pure 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.

Implemented in CDatagramSocketServerCallback, and CDatagramSocketServerCallback.

virtual void OnAllConnectionsAborted ( DWORD  numberOfConnectionsAborted  )  [pure virtual]

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

Implemented in CDatagramSocketServerCallback, and CDatagramSocketServerCallback.

virtual void OnShutdownInitiated (  )  [pure virtual]

Called when the server starts to shutdown.

Implemented in CDatagramSocketServerCallback, and CDatagramSocketServerCallback.

virtual void OnShutdownComplete (  )  [pure virtual]

Called when the server has finished its shutdown process.

Implemented in CDatagramSocketServerCallback, and CDatagramSocketServerCallback.

virtual void OnIncrementPendingReceives ( DWORD  pendingReceives  )  [pure virtual]

Called when the number of pending receives has increased. The value supplied is the new number of pending receives.

Implemented in CDatagramSocketServerCallback, and CDatagramSocketServerCallback.

virtual void OnDecrementPendingReceives ( DWORD  pendingReceives  )  [pure virtual]

Called when the number of pending receives has decreased. The value supplied is the new number of pending receives.

Implemented in CDatagramSocketServerCallback, and CDatagramSocketServerCallback.

virtual void OnConnectionClosure ( IDatagramServerSocket socket,
ConnectionClosureReason  reason 
) [pure virtual, inherited]

Called when the connection is closed.

Implemented in CDatagramSocketServerCallback, and CDatagramSocketServerCallback.

virtual void OnConnectionClosed ( IDatagramServerSocket socket  )  [pure virtual, inherited]

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.

Implemented in CDatagramSocketServerCallback, and CDatagramSocketServerCallback.

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


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