ConnectableSocket Class Reference

#include <ConnectableSocket.h>

Inheritance diagram for ConnectableSocket:

Socket TcpSocket List of all members.

Public Types

enum  IoState { state_eof = 0x01, state_failed = 0x02, state_raise_event = 0x04 }

Public Member Functions

std::ostream & operator<< (std::ostream &stream) const
void connectTo (const SocketAddress &address)
int read (void *buffer, int bytes)
int write (const void *buffer, int bytes)
bool isEof () const
bool isOk () const
bool isGood () const
bool eventOnEof () const
void eventOnEof (bool flag)
void clear ()
int receiveFrom (SocketAddress &address, void *buffer, int bytes)
SocketAddress peerAddress () const
bool isConnected () const

Protected Member Functions

 ConnectableSocket (SOCKET socketHandle)
 ConnectableSocket (int type, int domain, int protocol=0)
void connectTo (sockaddr *address, int size)
bool getFlags (short mask) const

Detailed Description

Note: Should be written to be more like the standard IOStreams. Including the stream and streambuffer conecpts

Definition at line 35 of file ConnectableSocket.h.


Member Enumeration Documentation

enum ConnectableSocket::IoState
 

Enumerator:
state_eof 
state_failed 
state_raise_event 

Definition at line 39 of file ConnectableSocket.h.


Constructor & Destructor Documentation

ConnectableSocket::ConnectableSocket SOCKET  socketHandle  )  [protected]
 

Definition at line 96 of file ConnectableSocket.cpp.

ConnectableSocket::ConnectableSocket int  type,
int  domain,
int  protocol = 0
[protected]
 

Definition at line 102 of file ConnectableSocket.cpp.


Member Function Documentation

void ConnectableSocket::clear  ) 
 

Definition at line 82 of file ConnectableSocket.cpp.

References Socket::flags_, and state_raise_event.

Referenced by connectTo().

void ConnectableSocket::connectTo sockaddr *  address,
int  size
[protected]
 

Definition at line 116 of file ConnectableSocket.cpp.

References clear(), Socket::getDescriptor(), and SOCKET_CALL_3.

void ConnectableSocket::connectTo const SocketAddress address  ) 
 

Definition at line 108 of file ConnectableSocket.cpp.

Referenced by SOAPonHTTP::send().

void ConnectableSocket::eventOnEof bool  flag  ) 
 

Definition at line 59 of file ConnectableSocket.cpp.

References Socket::flags_, and state_raise_event.

bool ConnectableSocket::eventOnEof  )  const
 

Definition at line 52 of file ConnectableSocket.cpp.

References Socket::flags_, and state_raise_event.

bool ConnectableSocket::getFlags short  mask  )  const [protected]
 

Definition at line 89 of file ConnectableSocket.cpp.

References Socket::flags_.

bool ConnectableSocket::isConnected  )  const
 

Definition at line 150 of file ConnectableSocket.cpp.

References peerAddress().

Referenced by operator<<().

bool ConnectableSocket::isEof  )  const
 

Definition at line 45 of file ConnectableSocket.cpp.

References Socket::flags_, and state_eof.

Referenced by isGood().

bool ConnectableSocket::isGood  )  const
 

Definition at line 75 of file ConnectableSocket.cpp.

References isEof(), and isOk().

bool ConnectableSocket::isOk  )  const
 

Definition at line 68 of file ConnectableSocket.cpp.

References Socket::flags_, Socket::isOpen(), and state_failed.

Referenced by isGood(), and receiveFrom().

std::ostream & ConnectableSocket::operator<< std::ostream &  stream  )  const
 

TcpServer Socket library

Copyright (c) 2000 Jasen Plietz All rights reserved.

No warranties are extended. Use at your own risk.

To contact the author with suggestions or comments, use Jasen@plietz.net

Reimplemented from Socket.

Definition at line 25 of file ConnectableSocket.cpp.

References Socket::getDescriptor(), isConnected(), Socket::isOpen(), and peerAddress().

SocketAddress ConnectableSocket::peerAddress  )  const
 

Definition at line 205 of file ConnectableSocket.cpp.

References Socket::getDescriptor(), and SOCKET_CALL_3.

Referenced by isConnected(), and operator<<().

int ConnectableSocket::read void *  buffer,
int  bytes
 

Definition at line 184 of file ConnectableSocket.cpp.

References NetworkException::eof_encountered, Socket::flags_, NetworkException::read_failed, socket_error, Socket::socketHandle, state_eof, state_failed, state_raise_event, and NetworkException::throwNetworkException().

Referenced by processSocket(), and SOAPonHTTP::send().

int ConnectableSocket::receiveFrom SocketAddress address,
void *  buffer,
int  bytes
 

Definition at line 128 of file ConnectableSocket.cpp.

References Socket::flags_, Socket::getDescriptor(), isOk(), SOCKET_CALL_6, and state_failed.

int ConnectableSocket::write const void *  buffer,
int  bytes
 

Definition at line 164 of file ConnectableSocket.cpp.

References Socket::flags_, socket_error, Socket::socketHandle, state_eof, state_failed, NetworkException::throwNetworkException(), and NetworkException::write_failed.

Referenced by SOAPonHTTP::send().


The documentation for this class was generated from the following files:
Generated on Tue Mar 28 09:10:15 2006 for Simple SOAP by  doxygen 1.4.6