Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

ippSocket Class Reference

List of all members.

Public Types

enum  SERROR {
  SOCKET_OK = 0, SOCKET_WOULD_BLOCK = 10035L, SOCKET_IS_CONNECTED = 10056L, SOCKET_CONNECTION_ABORTED,
  SOCKET_OTHER_ERROR = -1
}

Public Member Functions

 ippSocket ()
virtual ~ippSocket ()
bool Create ()
 create a socket and returns true if the socket has been successfully created.
SERROR Connect (const char *hostname, int port)
 connect to a server hostname on the specified port
void Close ()
 close the socket.
SERROR Read (char *buffer, int size)
SERROR Write (const char *sendbuf)
bool Listen (int portNumber)
 ask the socket to listen on the specified port number
SERROR Accept (ippSocket &socket)
SERROR CanSendData ()
bool IsValid () const
 returns true if the socket has been created.
SERROR Ping ()
 probe the connection to see if the other peer has disconnected

Static Public Member Functions

static bool Initialize ()

Protected Attributes

std::auto_ptr< ippSocketImp_imp

Friends

class ippSocketImp

Member Enumeration Documentation

enum ippSocket::SERROR
 

Enumeration values:
SOCKET_OK 
SOCKET_WOULD_BLOCK 
SOCKET_IS_CONNECTED 
SOCKET_CONNECTION_ABORTED 
SOCKET_OTHER_ERROR 

Definition at line 20 of file ippSocket.h.


Constructor & Destructor Documentation

ippSocket::ippSocket  ) 
 

Definition at line 90 of file ippSocket.cpp.

ippSocket::~ippSocket  )  [virtual]
 

Definition at line 97 of file ippSocket.cpp.

References Close().


Member Function Documentation

ippSocket::SERROR ippSocket::Accept ippSocket socket  ) 
 

Accept a incoming connection Accept is used by a listening socket to make a attempt

Definition at line 519 of file ippSocket.cpp.

References _imp.

Referenced by ippSpyServer::PerformListening().

ippSocket::SERROR ippSocket::CanSendData  ) 
 

Definition at line 163 of file ippSocket.cpp.

References _imp.

Referenced by ippSpyClient::HeartBeat(), and ippSimpleClient::HeartBeat().

void ippSocket::Close  ) 
 

close the socket.

close the socket

Definition at line 357 of file ippSocket.cpp.

References _imp.

Referenced by ippSpyClient::Connect(), ippSimpleClient::Connect(), ippSpyClient::Disconnect(), ippSimpleClient::Disconnect(), ippSpyClient::HeartBeat(), ippSimpleClient::HeartBeat(), ippSpyServer::PerformListening(), ippSpyServer::PowerOff(), ippSimpleServer::PowerOff(), ippEngine::ProbeConnection(), ippClientServerSpyTestCase::testSpy_with_uncompliant_client1(), ippEngine::~ippEngine(), and ~ippSocket().

ippSocket::SERROR ippSocket::Connect const char *  hostname,
int  port
 

connect to a server hostname on the specified port

Definition at line 121 of file ippSocket.cpp.

References _imp, IPP_ASSERT, and IsValid().

Referenced by ippSpyClient::Connect(), ippSimpleClient::Connect(), and ippClientServerSpyTestCase::testSpy_with_uncompliant_client1().

bool ippSocket::Create  ) 
 

create a socket and returns true if the socket has been successfully created.

create a socket

Definition at line 297 of file ippSocket.cpp.

References _imp.

Referenced by ippSpyClient::Connect(), ippSimpleClient::Connect(), and ippClientServerSpyTestCase::testSpy_with_uncompliant_client1().

bool ippSocket::Initialize  )  [static]
 

Initialize the WinSock layer check the version of the Winsock on the computer and returns true if the version is fine

Definition at line 404 of file ippSocket.cpp.

Referenced by ippSimpleServer::ippSimpleServer().

bool ippSocket::IsValid  )  const
 

returns true if the socket has been created.

ippSocket::IsValid

returns true if the socket is valid

Definition at line 560 of file ippSocket.cpp.

References _imp.

Referenced by Connect(), ippSpyServer::PerformListening(), ippEngine::ProbeConnection(), and ippClientServerSpyTestCase::testSpy_with_uncompliant_client1().

bool ippSocket::Listen int  portNumber  ) 
 

ask the socket to listen on the specified port number

method use to setup a Server listening socket

Definition at line 429 of file ippSocket.cpp.

References _imp.

Referenced by ippSpyServer::OnConnectionLost(), ippSpyServer::PowerOn(), and ippSimpleServer::PowerOn().

ippSocket::SERROR ippSocket::Ping  ) 
 

probe the connection to see if the other peer has disconnected

Ping verifying if the connection is still alive this method is useful to find out if a existing connection has not been broken expectantly returns no zero if the connection is broken

Definition at line 382 of file ippSocket.cpp.

References _imp.

Referenced by ippEngine::ProbeConnection().

ippSocket::SERROR ippSocket::Read char *  buffer,
int  size
 

read some string from the socket

Returns:
0 if no data can be read or if some data has been extracted

Definition at line 209 of file ippSocket.cpp.

References _imp.

ippSocket::SERROR ippSocket::Write const char *  sendbuf  ) 
 

write some string to the socket

Returns:
0 if the data has been written .

Definition at line 246 of file ippSocket.cpp.

References _imp.

Referenced by ippSpyClient::SendCommand(), ippSimpleClient::SendCommand(), ippClientServerSpyTestCase::testSpy_with_uncompliant_client1(), and ippSpyServer::WriteToSocket().


Friends And Related Function Documentation

friend class ippSocketImp [friend]
 

Definition at line 86 of file ippSocket.h.


Member Data Documentation

std::auto_ptr<ippSocketImp> ippSocket::_imp [protected]
 

Definition at line 83 of file ippSocket.h.

Referenced by Accept(), CanSendData(), Close(), Connect(), Create(), IsValid(), Listen(), Ping(), Read(), and Write().


The documentation for this class was generated from the following files:
Generated on Wed Nov 8 00:21:07 2006 for IPPDME by  doxygen 1.4.1