Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members

clSockServ Class Reference

Socket server class. More...

#include <SockServ.hh>

List of all members.

Public Member Functions

 clSockServ ()
 clSockServ (unsigned short)
 clSockServ (const char *)
 ~clSockServ ()
bool Bind (unsigned short)
 Bind to TCP port.

bool Bind (const char *, unsigned short)
 Bind to specific address and port.

bool Bind (const char *)
 Bind to UNIX domain socket.

int WaitForConnect ()
 Wait for connect.

int WaitForConnect (int)
 Wait for connect.

void Close ()
 Close listening socket.

int GetErrno ()
 Get errno.


Private Attributes

int iErrno
int iListenH
bool bLocal
char cpLocalSockName [UNIX_PATH_MAX+1]


Detailed Description

Socket server class.

Definition at line 44 of file SockServ.hh.


Constructor & Destructor Documentation

clSockServ::clSockServ  ) 
 

Definition at line 41 of file SockServ.cc.

References iErrno, and iListenH.

clSockServ::clSockServ unsigned  short  ) 
 

Definition at line 48 of file SockServ.cc.

References Bind(), and iErrno.

clSockServ::clSockServ const char *   ) 
 

Definition at line 55 of file SockServ.cc.

References Bind(), and iErrno.

clSockServ::~clSockServ  ) 
 

Definition at line 195 of file SockServ.cc.

References Close().


Member Function Documentation

bool clSockServ::Bind unsigned  short  ) 
 

Bind to TCP port.

Parameters:
usPort Port number
Returns:
Success

Definition at line 63 of file SockServ.cc.

References bLocal, iErrno, iListenH, and SOCKSERV_LISTENQUEUE_LEN.

Referenced by Bind(), clSockServ(), clXMMSOut::Init(), clStreamDist::Main(), clSoundSrvA::Main(), clSoundSrv2::Main(), clLocate::Main(), clComediSrv::Main(), clBeamSrv2Master::Main(), clBeamSrvMaster::Main(), clFileSrv::ServerThread(), and clSoundProxy::WaitConnectThread().

bool clSockServ::Bind const char *  ,
unsigned  short
 

Bind to specific address and port.

Parameters:
cpAddress Address
usPort Port
Returns:
Success

Definition at line 99 of file SockServ.cc.

References bLocal, iErrno, iListenH, and SOCKSERV_LISTENQUEUE_LEN.

bool clSockServ::Bind const char *   ) 
 

Bind to UNIX domain socket.

Parameters:
cpSockFile Filename
Returns:
Success

Definition at line 142 of file SockServ.cc.

References Bind(), bLocal, cpLocalSockName, GLOBAL_SOCKET_PATH, iErrno, iListenH, SOCKSERV_LISTENQUEUE_LEN, and UNIX_PATH_MAX.

int clSockServ::WaitForConnect  ) 
 

Wait for connect.

Note:
This has no timeout.
Returns:
Handle to new connection, -1 on error

Definition at line 201 of file SockServ.cc.

References bLocal, iErrno, and iListenH.

Referenced by clStreamDist::Main(), clSoundSrvA::Main(), clSoundSrv2::Main(), clLocate::Main(), clComediSrv::Main(), clXMMSOut::MainThread(), clFileSrv::ServerThread(), clBeamSrv2Master::ServerThread(), clBeamSrvMaster::ServerThread(), clUIServer::Wait(), and clSoundProxy::WaitConnectThread().

int clSockServ::WaitForConnect int   ) 
 

Wait for connect.

Note:
Check errno for timeout/error.
Parameters:
iTimeout Timeout (ms)
Returns:
Handle to new connection, -1 on error

Definition at line 229 of file SockServ.cc.

References bLocal, iErrno, and iListenH.

void clSockServ::Close  ) 
 

Close listening socket.

Definition at line 278 of file SockServ.cc.

References bLocal, cpLocalSockName, and iListenH.

Referenced by clXMMSOut::OnButtonClick(), and ~clSockServ().

int clSockServ::GetErrno  )  [inline]
 

Get errno.

Returns:
errno

Definition at line 103 of file SockServ.hh.

References iErrno.

Referenced by clUIServer::clUIServer(), clStreamDist::Main(), clBeamSrv2Master::Main(), clBeamSrvMaster::Main(), and clUIServer::Wait().


Member Data Documentation

int clSockServ::iErrno [private]
 

Definition at line 46 of file SockServ.hh.

Referenced by Bind(), clSockServ(), GetErrno(), and WaitForConnect().

int clSockServ::iListenH [private]
 

Definition at line 47 of file SockServ.hh.

Referenced by Bind(), Close(), clSockServ(), and WaitForConnect().

bool clSockServ::bLocal [private]
 

Definition at line 48 of file SockServ.hh.

Referenced by Bind(), Close(), and WaitForConnect().

char clSockServ::cpLocalSockName[UNIX_PATH_MAX + 1] [private]
 

Definition at line 49 of file SockServ.hh.

Referenced by Bind(), and Close().


The documentation for this class was generated from the following files:
Generated on Sun Oct 26 19:12:23 2003 for HASAS by doxygen 1.3.3