n2nc::net::TcpSocket Class Reference

Tcp Socket implementation. More...

#include <tcpsocket.h>

Inheritance diagram for n2nc::net::TcpSocket:

Inheritance graph
[legend]
Collaboration diagram for n2nc::net::TcpSocket:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 TcpSocket (int af)
Socketaccept ()
int setListen (int backlog=10)
bool isListen ()


Detailed Description

Tcp Socket implementation.

Author:
fabsoft <fabsoft@gmail.com>
Examples:

socket_ex.cpp.

Definition at line 14 of file tcpsocket.h.


Member Function Documentation

Socket * n2nc::net::TcpSocket::accept (  ) 

Accept a new incoming connection,

Returns:
a new Socket representing the new connected socket

cleanest way. i should fit sockaddr directly by getRawSockAddr() but i prefer a local copy and use constructor

this address can be gathered from getpeername()

FIXME all in this context: check for EAGAIN

Definition at line 22 of file tcpsocket.cpp.

References n2nc::net::Socket::m_af, n2nc::net::Socket::m_fd, m_islisten, and n2nc::net::Socket::m_type.

int n2nc::net::TcpSocket::setListen ( int  backlog = 10  ) 

Associate a socketaddress to this socket Sets this socket as listenig socket. Once used this socket become connection-oriented socket

Definition at line 10 of file tcpsocket.cpp.

References n2nc::net::Socket::m_fd, and n2nc::net::Socket::setSockOpt().

Referenced by n2nc::Server::listen().

Here is the call graph for this function:

Here is the caller graph for this function:


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

Generated on Mon Oct 6 19:32:54 2008 for n2nc by  doxygen 1.5.5