|
|
|
|
Documentation |
|
Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages Search
NLNET::CListenSock Class ReferenceCListenSock: listening socket for servers.
More...
#include <listen_sock.h>
Inheritance diagram for NLNET::CListenSock:
List of all members.
Public Methods |
| CListenSock () |
| Constructor. More...
|
CTcpSock * | accept () |
| Blocks until an incoming connection is requested, accepts it, and creates a new socket (you have to delete it after use). More...
|
|
void | init (uint16 port) |
| Prepares to receive connections on a specified port (bind+listen). More...
|
void | init (const CInetAddress &addr) |
| Prepares to receive connections on a specified address/port (useful when the host has several addresses). More...
|
void | setBacklog (sint backlog) |
| Sets the number of the pending connections queue, or -1 for the maximum possible value. More...
|
sint | backlog () const |
| Returns the pending connections queue. More...
|
Private Attributes |
bool | _Bound |
sint | _BackLog |
Detailed Description
CListenSock: listening socket for servers.
How to accept connections in a simple server:
- Create a CListenSock object
- Listen on the port you want the clients to connect
- In a loop, accept a connection and store the new socket
-
Author:
-
Olivier Cado , Nevrax France
-
Date:
-
2000-2001
Definition at line 47 of file listen_sock.h.
Constructor & Destructor Documentation
NLNET::CListenSock::CListenSock |
( |
|
) |
|
|
Member Function Documentation
CTcpSock * NLNET::CListenSock::accept |
( |
|
) |
|
|
sint NLNET::CListenSock::backlog |
( |
|
) |
const [inline] |
|
void NLNET::CListenSock::init |
( |
uint16 |
port |
) |
|
|
void NLNET::CListenSock::setBacklog |
( |
sint |
backlog |
) |
|
|
Member Data Documentation
sint NLNET::CListenSock::_BackLog [private]
|
|
bool NLNET::CListenSock::_Bound [private]
|
|
The documentation for this class was generated from the following files:
|
|