CStreamSocketServerExCallback Class Reference
[Stream SocketsSocket serversCallback eventsNull Objects]

Inheritance diagram for CStreamSocketServerExCallback:

Inheritance graph
[legend]
Collaboration diagram for CStreamSocketServerExCallback:

Collaboration graph
[legend]

List of all members.


Detailed Description

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

Public Member Functions

virtual void OnIncrementPendingReceives (const DWORD pendingReceives)
 Called when the number of pending receieves has increased. The value supplied is the new number of pending receives.
virtual void OnDecrementPendingReceives (const DWORD pendingReceives)
 Called when the number of pending receieves has decreased. The value supplied is the new number of pending receives.
virtual void OnStartAcceptingConnections ()
 Called when the server starts accepting connections.
virtual void OnStopAcceptingConnections ()
 Called when the server stops accepting connections.
virtual void OnShutdownInitiated ()
 Called when the server starts to shutdown.
virtual void OnShutdownComplete ()
 Called when the server has finished its shutdown process.
virtual void OnAcceptError (const DWORD lastError)
 Called when there is an error from the system call that the server makes to accept new connections. Not a lot you can do except log the error message... Possibly shouldn't be exposed to client code?
virtual void OnMaximumConnections ()
 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 OnPreOutgoingConnect (JetByteTools::Win32::IIndexedOpaqueUserData &userData, const IAddress &address, const void *pUserData) throw ()
 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.
virtual void OnConnectionEstablished (IStreamSocket &socket, const IAddress &address)
 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.
virtual void OnOutgoingConnectionFailed (IStreamSocket &socket, const IAddress &address, const DWORD lastError)
 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.
virtual void OnSocketReleased (JetByteTools::Win32::IIndexedOpaqueUserData &userData)
 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.
virtual void OnReadCompleted (IStreamSocket &socket, JetByteTools::IO::IBuffer &buffer)
 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 (IStreamSocket &socket, JetByteTools::IO::IBuffer &buffer, const DWORD lastError)
 Called when an asynchronous read completes with an error.
virtual void OnWriteCompleted (IStreamSocket &socket, JetByteTools::IO::IBuffer &buffer)
 Called when an asynchronous write completes. There's not a great deal that needs to be done here.
virtual void OnWriteCompletionError (IStreamSocket &socket, JetByteTools::IO::IBuffer &buffer, const DWORD lastError)
 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 OnError (IStreamSocket &socket, const JetByteTools::Win32::_tstring &message)
 Called when there is an error which is related to a particular connection (such as a failure to close a socket, or a failure to call shutdown, etc). Not a lot you can do except log the error message... Possibly shouldn't be exposed to client code?
virtual bool OnConnectionClosing (IStreamSocket &socket)
 Called when a connection is closing because the last outstanding reference has been released on a connection that is open. If you wish to call Close() for the connection yourself then do so and return true, else return false and AbortiveClose() will be called. Note that calling Close() from an I/O thread will block the thread for a period of time, you may prefer to consider marshalling the socket to one of your own threads and perform the lingering close from there...
virtual void OnConnectionClientClose (IStreamSocket &socket)
 Called when the 'read side' of the connection is closed by the remote end. The remote end of the connection can no longer send data to you as it has issued a shutdown() call and shut down at least the write side of its socket. This means that you can no longer read from the connection but you may still be able to write to the connection.
virtual void OnConnectionReset (IStreamSocket &socket, const DWORD lastError)
 Called when the connection is reset.
virtual void OnConnectionClosed (IStreamSocket &socket)
 Called when the connection is closed.
virtual void OnConnectionError (const ConnectionErrorSource source, IStreamSocket &socket, const JetByteTools::IO::IBuffer &buffer, const DWORD lastError)
 Called when there is an error which is related to a particular connection (such as a failure issue a read or write call on the socket, etc).
virtual void OnError (const JetByteTools::Win32::_tstring &message)
 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?

Member Function Documentation

void OnIncrementPendingReceives ( const DWORD  pendingReceives  )  [virtual]

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

Implements IStreamSocketServerExCallback.

void OnDecrementPendingReceives ( const DWORD  pendingReceives  )  [virtual]

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

Implements IStreamSocketServerExCallback.

void OnStartAcceptingConnections (  )  [virtual]

Called when the server starts accepting connections.

Implements IStreamSocketServerCallback.

void OnStopAcceptingConnections (  )  [virtual]

Called when the server stops accepting connections.

Implements IStreamSocketServerCallback.

void OnShutdownInitiated (  )  [virtual]

Called when the server starts to shutdown.

Implements IStreamSocketServerCallback.

void OnShutdownComplete (  )  [virtual]

Called when the server has finished its shutdown process.

Implements IStreamSocketServerCallback.

void OnAcceptError ( const DWORD  lastError  )  [virtual]

Called when there is an error from the system call that the server makes to accept new connections. Not a lot you can do except log the error message... Possibly shouldn't be exposed to client code?

Implements IStreamSocketServerCallback.

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

void OnPreOutgoingConnect ( JetByteTools::Win32::IIndexedOpaqueUserData userData,
const IAddress address,
const void *  pUserData 
) throw () [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 IStreamSocketConnectionManagerCallback.

void OnConnectionEstablished ( IStreamSocket socket,
const IAddress address 
) [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 IStreamSocketConnectionManagerCallback.

void OnOutgoingConnectionFailed ( IStreamSocket socket,
const IAddress address,
const DWORD  lastError 
) [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 IStreamSocketConnectionManagerCallback.

void OnSocketReleased ( JetByteTools::Win32::IIndexedOpaqueUserData userData  )  [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 IStreamSocketConnectionManagerCallback.

void OnReadCompleted ( IStreamSocket socket,
JetByteTools::IO::IBuffer buffer 
) [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 IStreamSocketConnectionManagerCallback.

virtual void OnReadCompletionError ( IStreamSocket socket,
JetByteTools::IO::IBuffer buffer,
const DWORD  lastError 
) [virtual]

Called when an asynchronous read completes with an error.

Implements IStreamSocketConnectionManagerCallback.

void OnWriteCompleted ( IStreamSocket socket,
JetByteTools::IO::IBuffer buffer 
) [virtual]

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

Implements IStreamSocketConnectionManagerCallback.

virtual void OnWriteCompletionError ( IStreamSocket socket,
JetByteTools::IO::IBuffer buffer,
const DWORD  lastError 
) [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 IStreamSocketConnectionManagerCallback.

virtual void OnError ( IStreamSocket socket,
const JetByteTools::Win32::_tstring message 
) [virtual]

Called when there is an error which is related to a particular connection (such as a failure to close a socket, or a failure to call shutdown, etc). Not a lot you can do except log the error message... Possibly shouldn't be exposed to client code?

Implements IStreamSocketCallback.

bool OnConnectionClosing ( IStreamSocket socket  )  [virtual]

Called when a connection is closing because the last outstanding reference has been released on a connection that is open. If you wish to call Close() for the connection yourself then do so and return true, else return false and AbortiveClose() will be called. Note that calling Close() from an I/O thread will block the thread for a period of time, you may prefer to consider marshalling the socket to one of your own threads and perform the lingering close from there...

Implements IStreamSocketCallback.

void OnConnectionClientClose ( IStreamSocket socket  )  [virtual]

Called when the 'read side' of the connection is closed by the remote end. The remote end of the connection can no longer send data to you as it has issued a shutdown() call and shut down at least the write side of its socket. This means that you can no longer read from the connection but you may still be able to write to the connection.

Implements IStreamSocketCallback.

void OnConnectionReset ( IStreamSocket socket,
const DWORD  lastError 
) [virtual]

Called when the connection is reset.

Implements IStreamSocketCallback.

void OnConnectionClosed ( IStreamSocket socket  )  [virtual]

Called when the connection is closed.

Implements IStreamSocketCallback.

void OnConnectionError ( const ConnectionErrorSource  source,
IStreamSocket socket,
const JetByteTools::IO::IBuffer buffer,
const DWORD  lastError 
) [virtual]

Called when there is an error which is related to a particular connection (such as a failure issue a read or write call on the socket, etc).

Implements IStreamSocketCallback.

virtual void OnError ( const JetByteTools::Win32::_tstring message  )  [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.


Generated on Tue Oct 2 15:45:35 2007 for JetByte Tools - v5.2 by  doxygen 1.5.3