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

SocketSource Class Reference

#include <socketft.h>

Inheritance diagram for SocketSource:

NetworkSource Socket NonblockingSource List of all members.

Detailed Description

Definition at line 184 of file socketft.h.

Public Member Functions

 SocketSource (socket_t s=INVALID_SOCKET, bool pumpAll=false, BufferedTransformation *attachment=NULL)
unsigned int GetMaxWaitObjectCount () const
void GetWaitObjects (WaitObjectContainer &container)
unsigned int GeneralPump2 (unsigned long &byteCount, bool blockingOutput=true, unsigned long maxTime=INFINITE_TIME, bool checkDelimiter=false, byte delimiter='\n')
 pump up to maxSize bytes using at most maxTime milliseconds

bool SourceExhausted () const
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
NONBLOCKING SOURCE
unsigned long GeneralPump (unsigned long maxSize=ULONG_MAX, unsigned long maxTime=INFINITE_TIME, bool checkDelimiter=false, byte delimiter='\n')
unsigned long TimedPump (unsigned long maxTime)
unsigned long PumpLine (byte delimiter='\n', unsigned long maxSize=1024)
unsigned int Pump2 (unsigned long &byteCount, bool blocking=true)
unsigned int PumpMessages2 (unsigned int &messageCount, bool blocking=true)

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

const NetworkReceiverGetReceiver () const
virtual void SocketChanged ()

Protected Attributes

socket_t m_s
bool m_own


Member Function Documentation

unsigned int NetworkSource::GeneralPump2 unsigned long &  byteCount,
bool  blockingOutput = true,
unsigned long  maxTime = INFINITE_TIME,
bool  checkDelimiter = false,
byte  delimiter = '\n'
[virtual, inherited]
 

pump up to maxSize bytes using at most maxTime milliseconds

If checkDelimiter is true, pump up to delimiter, which itself is not extracted or pumped.

Implements NonblockingSource.

Definition at line 40 of file network.cpp.

References SecBlock< T, A >::begin(), Timer::ElapsedTime(), NetworkReceiver::EofReceived(), NetworkReceiver::GetReceiveResult(), INFINITE_TIME, NetworkReceiver::MustWaitForResult(), NetworkReceiver::MustWaitToReceive(), NetworkReceiver::Receive(), SecBlock< T, A >::size(), and Waitable::Wait().


The documentation for this class was generated from the following file:
Generated on Sun Mar 14 20:44:42 2004 for Crypto++ by doxygen 1.3.6-20040222