bitz-server  0.1.6
Public Member Functions | Friends | List of all members
socketlibrary::TCPSocket Class Reference

#include <socket.h>

Inheritance diagram for socketlibrary::TCPSocket:
socketlibrary::CommunicatingSocket socketlibrary::Socket

Public Member Functions

 TCPSocket () throw (SocketException)
 
 TCPSocket (const string &foreignAddress, unsigned short foreignPort) throw (SocketException)
 
- Public Member Functions inherited from socketlibrary::CommunicatingSocket
void connect (const string &foreignAddress, unsigned short foreignPort) throw (SocketException)
 
void send (const void *buffer, int bufferLen) throw (SocketException)
 
int recv (void *buffer, int bufferLen) throw (SocketException)
 
int peek (void *buffer, int bufferLen) throw (SocketException)
 
int readLine (char *buffer, int bufferLen, const char delimiter= '\n') throw (SocketException)
 
string getForeignAddress () throw (SocketException)
 
unsigned short getForeignPort () throw (SocketException)
 
- Public Member Functions inherited from socketlibrary::Socket
 ~Socket ()
 
string getLocalAddress () throw (SocketException)
 
unsigned short getLocalPort () throw (SocketException)
 
void setLocalPort (unsigned short localPort) throw (SocketException)
 
void setLocalAddressAndPort (const string &localAddress, unsigned short localPort=0) throw (SocketException)
 

Friends

class TCPServerSocket
 
class TCPServerSocketM
 

Additional Inherited Members

- Static Public Member Functions inherited from socketlibrary::Socket
static void cleanUp () throw (SocketException)
 
static unsigned short resolveService (const string &service, const string &protocol="tcp")
 
- Protected Member Functions inherited from socketlibrary::CommunicatingSocket
 CommunicatingSocket (int type, int protocol) throw (SocketException)
 
 CommunicatingSocket (int newSD)
 
- Protected Member Functions inherited from socketlibrary::Socket
 Socket (int type, int protocol) throw (SocketException)
 
 Socket (int sock)
 
- Protected Attributes inherited from socketlibrary::Socket
int sock
 

Detailed Description

TCP socket for communication with other TCP sockets

Constructor & Destructor Documentation

socketlibrary::TCPSocket::TCPSocket ( )
throw (SocketException
)

Construct a TCP socket with no connection

Exceptions
SocketExceptionthrown if unable to create TCP socket
socketlibrary::TCPSocket::TCPSocket ( const string &  foreignAddress,
unsigned short  foreignPort 
)
throw (SocketException
)

Construct a TCP socket with a connection to the given foreign address and port

Parameters
foreignAddressforeign address (IP address or name)
foreignPortforeign port
Exceptions
SocketExceptionthrown if unable to create TCP socket