TC::Net::Socket Class Reference
[Networking]

Interface class makeing comminication over sockets. More...

#include <TCNetSocket.h>

Inheritance diagram for TC::Net::Socket:

Inheritance graph
[legend]
Collaboration diagram for TC::Net::Socket:

Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual ~Socket ()
virtual bool Open (PortNumber port_number)=0
virtual bool Connect (const char *server_name, PortNumber port_number)=0
 Connect this socket to specified server ad specified port number.
virtual bool Accept (SocketPtr socket)=0
 Attach this socket object to an already opened socket id by accepting new connection on the incoming data.
virtual bool Close ()=0
 Close the socket (connection).
virtual bool IsOpened () const =0
 Check if the socket is allready opened.
virtual PortNumber GetPortNumber () const =0
virtual SocketId GetSocket ()=0
 get id of current socket
virtual uint32 WriteBytes (uint32 nBytes, const void *bytes)=0
virtual uint32 ReadBytes (uint32 nBytes, void *bytes, bool block=true)=0


Detailed Description

Interface class makeing comminication over sockets.

Definition at line 65 of file TCNetSocket.h.


Constructor & Destructor Documentation

virtual TC::Net::Socket::~Socket (  )  [inline, virtual]

Definition at line 68 of file TCNetSocket.h.


Member Function Documentation

virtual bool TC::Net::Socket::Open ( PortNumber  port_number  )  [pure virtual]

virtual bool TC::Net::Socket::Connect ( const char *  server_name,
PortNumber  port_number 
) [pure virtual]

Connect this socket to specified server ad specified port number.

Parameters:
server_name Name of the server to connect to
port_number Port number to use to connect to the server
Returns:
true is connected

virtual bool TC::Net::Socket::Accept ( SocketPtr  socket  )  [pure virtual]

Attach this socket object to an already opened socket id by accepting new connection on the incoming data.

Parameters:
socket The socket in listening mode for accepting new connection
Returns:
true is attached

virtual bool TC::Net::Socket::Close (  )  [pure virtual]

Close the socket (connection).

virtual bool TC::Net::Socket::IsOpened (  )  const [pure virtual]

Check if the socket is allready opened.

virtual PortNumber TC::Net::Socket::GetPortNumber (  )  const [pure virtual]

Returns:
getting the port number of current connection

virtual SocketId TC::Net::Socket::GetSocket (  )  [pure virtual]

get id of current socket

virtual uint32 TC::Net::Socket::WriteBytes ( uint32  nBytes,
const void *  bytes 
) [pure virtual]

virtual uint32 TC::Net::Socket::ReadBytes ( uint32  nBytes,
void *  bytes,
bool  block = true 
) [pure virtual]


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

Copyright (c) Thomas Goessler 2003 - 2008