Public Member Functions | |
void | OnStartAcceptingConnections () override |
Called when the server starts accepting connections. | |
void | OnStopAcceptingConnections () override |
Called when the server stops accepting connections. | |
void | OnSocketCreated (SOCKET s) override |
Called just after a socket is created. Allows you to adjust socket options that are not otherwise accessible via the framework. Use with care. | |
void | OnSocketReleased (JetByteTools::Core::IIndexedOpaqueUserData &userData) override |
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 (JetByteTools::Socket::IDatagramServerSocket &socket, DWORD lastError) override |
Called when the connection is reset. | |
void | OnConnectionClosure (JetByteTools::Socket::IDatagramServerSocket &socket, JetByteTools::Socket::ConnectionClosureReason reason) override |
Called when the connection is closed. | |
void | OnConnectionClosed (JetByteTools::Socket::IDatagramServerSocket &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 | OnReadCompleted (JetByteTools::Socket::IDatagramServerSocket &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 (JetByteTools::Socket::IDatagramServerSocket &socket, JetByteTools::IO::CSmartBuffer &buffer, DWORD lastError) override |
Called when an asynchronous read completes with an error. | |
void | OnWriteCompleted (JetByteTools::Socket::IDatagramServerSocket &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 (JetByteTools::Socket::IDatagramServerSocket &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 | OnSendToCompleted (JetByteTools::Socket::IDatagramServerSocket &socket, const JetByteTools::Socket::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 (JetByteTools::Socket::IDatagramServerSocket &socket, const JetByteTools::Socket::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 server starts to shutdown. | |
void | OnShutdownComplete () override |
Called when the server has finished its shutdown process. | |
void | OnIncrementPendingReceives (DWORD pendingReceives) override |
Called when the number of pending receives has increased. The value supplied is the new number of pending receives. | |
void | OnDecrementPendingReceives (DWORD pendingReceives) override |
Called when the number of pending receives has decreased. The value supplied is the new number of pending receives. | |
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 |
void OnStartAcceptingConnections | ( | ) | [override, virtual] |
void OnStopAcceptingConnections | ( | ) | [override, virtual] |
void OnSocketCreated | ( | SOCKET | s | ) | [override, 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.
Implements IDatagramSocketServerCallback.
void OnSocketReleased | ( | JetByteTools::Core::IIndexedOpaqueUserData & | userData | ) | [override, 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.
Implements IDatagramSocketServerCallback.
void OnConnectionReset | ( | JetByteTools::Socket::IDatagramServerSocket & | socket, | |
DWORD | lastError | |||
) | [override, virtual] |
void OnConnectionClosure | ( | JetByteTools::Socket::IDatagramServerSocket & | socket, | |
JetByteTools::Socket::ConnectionClosureReason | reason | |||
) | [override, virtual] |
void OnConnectionClosed | ( | JetByteTools::Socket::IDatagramServerSocket & | 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 IDatagramServerSocketCallback.
void OnReadCompleted | ( | JetByteTools::Socket::IDatagramServerSocket & | 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 IDatagramSocketServerCallback.
void OnReadCompletionError | ( | JetByteTools::Socket::IDatagramServerSocket & | socket, | |
JetByteTools::IO::CSmartBuffer & | buffer, | |||
DWORD | lastError | |||
) | [override, virtual] |
void OnWriteCompleted | ( | JetByteTools::Socket::IDatagramServerSocket & | 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 IDatagramSocketServerCallback.
void OnWriteCompletionError | ( | JetByteTools::Socket::IDatagramServerSocket & | 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 IDatagramSocketServerCallback.
void OnSendToCompleted | ( | JetByteTools::Socket::IDatagramServerSocket & | socket, | |
const JetByteTools::Socket::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 IDatagramSocketServerCallback.
void OnSendToCompletionError | ( | JetByteTools::Socket::IDatagramServerSocket & | socket, | |
const JetByteTools::Socket::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 IDatagramSocketServerCallback.
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 IDatagramSocketServerCallback.
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 IDatagramSocketServerCallback.
void OnShutdownInitiated | ( | ) | [override, virtual] |
void OnShutdownComplete | ( | ) | [override, virtual] |
void OnIncrementPendingReceives | ( | DWORD | pendingReceives | ) | [override, virtual] |
Called when the number of pending receives has increased. The value supplied is the new number of pending receives.
Implements IDatagramSocketServerCallback.
void OnDecrementPendingReceives | ( | DWORD | pendingReceives | ) | [override, virtual] |
Called when the number of pending receives has decreased. The value supplied is the new number of pending receives.
Implements IDatagramSocketServerCallback.
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.