Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

Socket Class Reference

Inherits IOHandle.

Inherited by TCPSocket.

List of all members.


Detailed Description

A network Socket descriptor.

This class will be expanded to include Socket-specific I/O methods.


Public Types

enum  flags { none = 0, nonblocking = 1, acceptor = 2 }

Public Methods

 Socket ()
 Null constructor.

 Socket (const IOHandle &ioh)
 Constructs a Socket from a given IOHandle.

Status stat ()
 Updates the Socket error state if there's no current error (useful after a connect).

Address getpeername ()
 Returns the peer name of the Socket, if any.

Address getsockname ()
 Returns the local name of the Socket, if any.

Status bind (const Address &a)
 Attempts to bind the Socket.

Status connect (const Address &a)
 Attempts to connect the Socket.

Status listen (int backlog=5)
 Listens on the Socket.

Socket accept (Address &a)
 Attempts to accept a connection on the Socket.


Static Public Methods

int sys_socket (int a, int b, int c)

Protected Methods

 Socket (int fd)
 Socket (int family, int type)
 Socket (int family, int type, Address addr, flags f=none)


Member Enumeration Documentation

enum Socket::flags
 

Enumeration values:
none 
nonblocking 
acceptor 


Constructor & Destructor Documentation

Socket::Socket int    fd [protected]
 

Socket::Socket int    family,
int    type
[protected]
 

Socket::Socket int    family,
int    type,
Address    addr,
flags    f = none
[protected]
 

Socket::Socket  
 

Null constructor.

Socket::Socket const IOHandle   ioh
 

Constructs a Socket from a given IOHandle.


Member Function Documentation

Socket Socket::accept Address   a
 

Attempts to accept a connection on the Socket.

Status Socket::bind const Address   a
 

Attempts to bind the Socket.

Status Socket::connect const Address   a
 

Attempts to connect the Socket.

Address Socket::getpeername  
 

Returns the peer name of the Socket, if any.

Address Socket::getsockname  
 

Returns the local name of the Socket, if any.

Status Socket::listen int    backlog = 5
 

Listens on the Socket.

Status Socket::stat  
 

Updates the Socket error state if there's no current error (useful after a connect).

Returns true if there is no error on the Socket.

int Socket::sys_socket int    a,
int    b,
int    c
[static]
 


The documentation for this class was generated from the following file:
Generated on Fri Dec 20 13:35:11 2002 for NMSTL