Utility class to handle n2bConnection pointers, providing nClose
More...
Public Member Functions | |
n2bFactory () | |
Constructor to open the socket. More... | |
virtual | ~n2bFactory () |
Destructor to close all opened connections and the socket. More... | |
abstract FUNCTION_AS_n2bConnection_PTR | nOpen () |
FUNCTION_AS_CONST_ZSTRING_CONST_PTR | nClose (BYVAL_AS_n2bConnection_PTR) |
Close a connection. More... | |
Public Attributes | |
ZSTRING_PTR | Errr |
The common error message (NULL in case of no error) More... | |
n2bConnection_PTR | Slots [ANY] |
The array to store open connections. More... | |
Protected Member Functions | |
FUNCTION_AS_n2bConnection_PTR | slot (BYVAL_AS_LONG) |
Generate a new connection and add the instance to array Slots. More... | |
Protected Attributes | |
LONG | Sock |
The socket to use. More... | |
Utility class to handle n2bConnection pointers, providing nClose
The base class of the nettobac instances. It manages the connection instances and provides the methods to open connections, to collects their pointers in the array n2bFactory::Slots and to close a connection manualy. The destructor closes all remaining connections.
See section n2bFactory for a list of possible error messages.
Definition at line 57 of file nettobac.bi.
n2bFactory::n2bFactory | ( | ) |
Constructor to open the socket.
The constructor opens a socket for the new instance (client or server) and checks the result.
Definition at line 156 of file nettobac.bas.
|
virtual |
Destructor to close all opened connections and the socket.
The destructor DELETE
s all open connections and closes the socket opened in the constructor.
Definition at line 169 of file nettobac.bas.
|
pure virtual |
Implemented in nettobacServer, and nettobacClient.
FUNCTION_AS_CONST_ZSTRING_CONST_PTR n2bFactory::nClose | ( | BYVAL_AS_n2bConnection_PTR | Con | ) |
Close a connection.
Con | The pointer to the connection instance |
Call this function in order to close a connection.
Definition at line 208 of file nettobac.bas.
|
protected |
Generate a new connection and add the instance to array Slots.
Socket | The socket number for that new connection |
This function collects pointers to newly created connections in the array Slots, in order to auto DELETE
the instances in the destructor. If you want to get rid of a connection before the destructor gets called, use method nClose().
Definition at line 188 of file nettobac.bas.
ZSTRING_PTR n2bFactory::Errr |
The common error message (NULL
in case of no error)
Definition at line 59 of file nettobac.bi.
n2bConnection_PTR n2bFactory::Slots[ANY] |
The array to store open connections.
In case of a server instance use this array to scan over all open connections. See function doServer() for an example.
Definition at line 66 of file nettobac.bi.
|
protected |
The socket to use.
Definition at line 72 of file nettobac.bi.