nettobac  0.0.0
Network features for FreeBASIC code
nettobacServer Class Reference

The server class, providing nOpen More...

Inheritance diagram for nettobacServer:
Collaboration diagram for nettobacServer:

Public Member Functions

 nettobacServer (BYVAL_AS_USHORT, BYVAL_AS_INTEGER)
 Generate a server instance. More...
 
virtual FUNCTION_AS_n2bConnection_PTR nOpen ()
 Open a server connection to a client. More...
 
- Public Member Functions inherited from n2bFactory
 n2bFactory ()
 Constructor to open the socket. More...
 
virtual ~n2bFactory ()
 Destructor to close all opened connections and the socket. More...
 
FUNCTION_AS_CONST_ZSTRING_CONST_PTR nClose (BYVAL_AS_n2bConnection_PTR)
 Close a connection. More...
 

Protected Attributes

timeval Timeout
 The timeout value to abort slow or impossible transmissions. More...
 
- Protected Attributes inherited from n2bFactory
LONG Sock
 The socket to use. More...
 

Additional Inherited Members

- Public Attributes inherited from n2bFactory
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 inherited from n2bFactory
FUNCTION_AS_n2bConnection_PTR slot (BYVAL_AS_LONG)
 Generate a new connection and add the instance to array Slots. More...
 

Detailed Description

The server class, providing nOpen

This class is an instance to act as a server. This is

  • listening to a port
  • accepting client connection requests
  • receiving data requests
  • sending data

See section nettobacServer for a list of possible error messages.

Since
0.0.0

Definition at line 109 of file nettobac.bi.

Constructor & Destructor Documentation

nettobacServer::nettobacServer ( BYVAL_AS_USHORT  Port = 80,
BYVAL_AS_INTEGER  Max = 64 
)

Generate a server instance.

Parameters
Portthe port number to use (defaults to 80)
MaxThe maximum number of client connections

Create a server instance for a limited number of clients and start listening on the specified port.

Since
0.0.0

Definition at line 271 of file nettobac.bas.

Member Function Documentation

FUNCTION_AS_n2bConnection_PTR nettobacServer::nOpen ( )
virtual

Open a server connection to a client.

Returns
A pointer to a new n2bConnection instance (or zero on failure)

This function opens a connection to a client, if a request is pending. It opens a new n2bConnection to the client and returns its pointer. Otherwise it returns 0 (zero), meaning there is no client connection request pending.

Use function n2bFactory::nClose() to close the connection.

Note
The BASE class n2bFactory will close all remaining connections in its destructor, so it's optional to call function n2bFactory::nClose().
Since
0.0.0

Implements n2bFactory.

Definition at line 306 of file nettobac.bas.

Member Data Documentation

timeval nettobacServer::Timeout
protected

The timeout value to abort slow or impossible transmissions.

Definition at line 114 of file nettobac.bi.


The documentation for this class was generated from the following files: