Exception Specifications
[Programming Concepts]

Collaboration diagram for Exception Specifications:

Detailed Description

Whilst exception specifications in C++ can, at first glance, seem like a good idea, they're not. The problem is that, unlike Java, the exception specification is not enforced at compile time, they're just a runtime thing. If an exception that isn't in the exception specification is thrown by a function then unexpected() may (or may not if you're Visual C++) be called. As such we view exception specifications as of limited use in C++. However: we do use a 'no throw' (throw()) exception specification to indicate that a function does not throw exceptions. We rarely use a 'no throw' specification to indicate that YOU should not throw exceptions, simply because we don't trust you ;)

This section contains links to the code that implements this concept.


Functions

virtual bool TryRead ()=0 throw ()
 Attempts to read from the connection. Returns false if the connection is closed.
virtual bool TryWrite (const char *pData, const DataLength dataLength)=0 throw ()
 Attempts to write to the connection. Returns false if the connection is closed.
virtual bool TryWrite (const BYTE *pData, const DataLength dataLength)=0 throw ()
 Attempts to write to the connection. Returns false if the connection is closed.
virtual bool TryWrite (JetByteTools::IO::IBuffer &buffer)=0 throw ()
 Attempts to write to the connection. Returns false if the connection is closed.
virtual bool TryWrite (const char *pData, const DataLength dataLength)=0 throw ()
virtual bool TryWrite (const BYTE *pData, const DataLength dataLength)=0 throw ()
virtual bool TryWrite (JetByteTools::IO::IBuffer &buffer)=0 throw ()
virtual bool TrySendTo (const IAddress &address, const char *pData, const DataLength dataLength)=0 throw ()
virtual bool TrySendTo (const IAddress &address, const BYTE *pData, const DataLength dataLength)=0 throw ()
virtual bool TrySendTo (const IAddress &address, JetByteTools::IO::IBuffer &buffer)=0 throw ()
virtual void OnPreOutgoingConnect (JetByteTools::Win32::IIndexedOpaqueUserData &userData, const IAddress &address, const void *pUserData)=0 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 OnPreOutgoingConnect (JetByteTools::Win32::IIndexedOpaqueUserData &userData, const IAddress &address, const void *pUserData)=0 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(), AsyncConnect() or AsyncConnectNoThrow() call. This is usually used to slot the pointer to user data into the socket's 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.
bool ConnectNoThrow (const IAddress &address) throw ()
 Attempts to connect the socket to the given address. Returns false on failure.
static bool ConnectNoThrow (SOCKET socket, const IAddress &address) throw ()
 Attempts to connect the supplied socket to the given address. Returns false on failure.
virtual int Run ()=0 throw ()
 The return value is the exit code of the thread that is run to execute the code.
BRelease () throw ()


Function Documentation

bool ConnectNoThrow ( SOCKET  socket,
const IAddress address 
) throw () [static, inherited]

Attempts to connect the supplied socket to the given address. Returns false on failure.

bool ConnectNoThrow ( const IAddress address  )  throw () [inherited]

Attempts to connect the socket to the given address. Returns false on failure.

virtual void OnPreOutgoingConnect ( JetByteTools::Win32::IIndexedOpaqueUserData userData,
const IAddress address,
const void *  pUserData 
) throw () [pure virtual, inherited]

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(), AsyncConnect() or AsyncConnectNoThrow() call. This is usually used to slot the pointer to user data into the socket's 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.

Implemented in CStreamSocketConnectionManagerCallback, CStreamSocketServerCallback, CStreamSocketConnectionManagerCallback, CStreamSocketServerCallback, CStreamSocketConnectionManagerCallback, CStreamSocketServerCallback, CStreamSocketServerExCallback, CStreamSocketConnectionManagerCallback, CStreamSocketServerCallback, and CStreamSocketServerExCallback.

virtual void OnPreOutgoingConnect ( JetByteTools::Win32::IIndexedOpaqueUserData userData,
const IAddress address,
const void *  pUserData 
) throw () [pure virtual, inherited]

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.

Implemented in CDatagramSocketConnectionManagerCallback, and CDatagramSocketConnectionManagerCallback.

B * Release (  )  throw () [inline, inherited]

virtual int Run (  )  throw () [pure virtual, inherited]

The return value is the exit code of the thread that is run to execute the code.

virtual bool TryRead (  )  throw () [pure virtual, inherited]

Attempts to read from the connection. Returns false if the connection is closed.

Implemented in TAsyncSocket< JetByteTools::Socket::IPoolableDatagramSocket, JetByteTools::Socket::IDatagramSocketConnectionManager, JetByteTools::Socket::IDatagramSocketCallback >, and TAsyncSocket< JetByteTools::Socket::IPoolableStreamSocket, JetByteTools::Socket::IStreamSocketConnectionManager, JetByteTools::Socket::IStreamSocketCallback >.

virtual bool TrySendTo ( const IAddress address,
JetByteTools::IO::IBuffer buffer 
) throw () [pure virtual, inherited]

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

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

virtual bool TryWrite ( JetByteTools::IO::IBuffer buffer  )  throw () [pure virtual, inherited]

Implemented in TAsyncSocket< JetByteTools::Socket::IPoolableDatagramServerSocket, JetByteTools::Socket::IDatagramServerSocketConnectionManager, JetByteTools::Socket::IDatagramServerSocketCallback >.

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

Implemented in TAsyncSocket< JetByteTools::Socket::IPoolableDatagramServerSocket, JetByteTools::Socket::IDatagramServerSocketConnectionManager, JetByteTools::Socket::IDatagramServerSocketCallback >.

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

Implemented in TAsyncSocket< JetByteTools::Socket::IPoolableDatagramServerSocket, JetByteTools::Socket::IDatagramServerSocketConnectionManager, JetByteTools::Socket::IDatagramServerSocketCallback >.

virtual bool TryWrite ( JetByteTools::IO::IBuffer buffer  )  throw () [pure virtual, inherited]

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

Implemented in TAsyncSocket< JetByteTools::Socket::IPoolableDatagramSocket, JetByteTools::Socket::IDatagramSocketConnectionManager, JetByteTools::Socket::IDatagramSocketCallback >, and TAsyncSocket< JetByteTools::Socket::IPoolableStreamSocket, JetByteTools::Socket::IStreamSocketConnectionManager, JetByteTools::Socket::IStreamSocketCallback >.

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

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

Implemented in TAsyncSocket< JetByteTools::Socket::IPoolableDatagramSocket, JetByteTools::Socket::IDatagramSocketConnectionManager, JetByteTools::Socket::IDatagramSocketCallback >, and TAsyncSocket< JetByteTools::Socket::IPoolableStreamSocket, JetByteTools::Socket::IStreamSocketConnectionManager, JetByteTools::Socket::IStreamSocketCallback >.

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

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

Implemented in TAsyncSocket< JetByteTools::Socket::IPoolableDatagramSocket, JetByteTools::Socket::IDatagramSocketConnectionManager, JetByteTools::Socket::IDatagramSocketCallback >, and TAsyncSocket< JetByteTools::Socket::IPoolableStreamSocket, JetByteTools::Socket::IStreamSocketConnectionManager, JetByteTools::Socket::IStreamSocketCallback >.


Generated on Mon Sep 7 14:07:45 2009 for JetByte Socket Tools - v6.1 by  doxygen 1.5.3