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

Socket Class Reference

#include <socketft.h>

Inheritance diagram for Socket:

SocketSink SocketSource List of all members.

Detailed Description

wrapper for Windows or Berkeley Sockets

Definition at line 43 of file socketft.h.

Public Member Functions

 Socket (socket_t s=INVALID_SOCKET, bool own=false)
 Socket (const Socket &s)
bool GetOwnership () const
void SetOwnership (bool own)
 operator socket_t ()
socket_t GetSocket () const
void AttachSocket (socket_t s, bool own=false)
socket_t DetachSocket ()
void CloseSocket ()
void Create (int nType=SOCK_STREAM)
void Bind (unsigned int port, const char *addr=NULL)
void Bind (const sockaddr *psa, socklen_t saLen)
void Listen (int backlog=5)
bool Connect (const char *addr, unsigned int port)
bool Connect (const sockaddr *psa, socklen_t saLen)
bool Accept (Socket &s, sockaddr *psa=NULL, socklen_t *psaLen=NULL)
void GetSockName (sockaddr *psa, socklen_t *psaLen)
unsigned int Send (const byte *buf, unsigned int bufLen, int flags=0)
unsigned int Receive (byte *buf, unsigned int bufLen, int flags=0)
void ShutDown (int how=SD_SEND)
void IOCtl (long cmd, unsigned long *argp)
bool SendReady (const timeval *timeout)
bool ReceiveReady (const timeval *timeout)
virtual void HandleError (const char *operation) const
void CheckAndHandleError_int (const char *operation, int result) const
void CheckAndHandleError (const char *operation, socket_t result) const
void CheckAndHandleError (const char *operation, BOOL result) const

Static Public Member Functions

unsigned int PortNameToNumber (const char *name, const char *protocol="tcp")
 look up the port number given its name, returns 0 if not found
void StartSockets ()
 start Windows Sockets 2
void ShutdownSockets ()
 calls WSACleanup for Windows Sockets
int GetLastError ()
 returns errno or WSAGetLastError
void SetLastError (int errorCode)
 sets errno or calls WSASetLastError

Protected Member Functions

virtual void SocketChanged ()

Protected Attributes

socket_t m_s
bool m_own

The documentation for this class was generated from the following files:
Generated on Wed Jul 21 19:16:10 2004 for Crypto++ by doxygen 1.3.7-20040704