Socket Class Reference
[Sockets]

Base socket type, you probably want to use TcpSocket or ServerSocket instead. TcpSocket ServerSocket. More...

#include <Socket.h>

Inheritance diagram for Socket:
IMemoryValidate

List of all members.

Public Member Functions

 Socket (const Socket &sock)
 Socket (int port)
Socketoperator= (const Socket &sock)
void SetAddrReuseOn ()
void SetNonBlocking ()
void SetBlocking ()
void Send (const Array< byte > &data, const int offset, const int len)
 write to sock
void Send (const Array< byte > &data, const int len)
void Send (const Array< byte > &data)
void Send (const String &str)
int Recv (Array< byte > &buf, const int offset, const int blen)
 pull data from sock.
int Recv (Array< byte > &buf, const int blen)
int RecvByte ()
void Flush ()
int GetBytesAvail ()
SOCKET GetFD () const
const SOCKADDR_IN * GetAddr () const
virtual bool IsClosed ()
void Close ()
void Shutdown (int i=SD_BOTH)
void SetLingerOn ()
void SetLingerOff ()
void SetNoDelay ()
void SetSendTimeout (int toMS)
void SetRecvTimeout (int toMS)
int GetSendTimeout ()
int GetRecvTimeout ()
int GetErrorCode () const
String GetRemoteIp ()
void CheckMem () const
void ValidateMem () const

Static Public Member Functions

static void ShutdownService ()

Protected Member Functions

void SetAddrReuse (int i)
 Socket (SOCKET fd, bool dummy)
void Init ()
 Socket (int port, int family, int streamType, int protocol)

Static Protected Member Functions

static void sinit ()

Protected Attributes

int m_errorStatus
SOCKET m_fd
SOCKADDR_IN m_saAddr
bool m_closed

Static Protected Attributes

static bool m_inited = false

Friends

class ServerSocket
class TcpSocket
class UdpSocket

Detailed Description

Base socket type, you probably want to use TcpSocket or ServerSocket instead. TcpSocket ServerSocket.

Definition at line 126 of file Socket.h.


Constructor & Destructor Documentation

Socket::Socket ( int  port,
int  family,
int  streamType,
int  protocol 
) [protected]

int domain, // AF_UNIX,AF_INET,AF_ISO,AF_NS,AF_IMPLINK int type, // SOCK_STREAM,SOCK_DGRAM,SOCK_RAW,... int protocol); // AF_UNSPEC,AF_UNIX,AF_INET,AF_AX25,AF_IPX

Definition at line 109 of file Socket.cpp.


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