GNet::SocketProtocol Class Reference

A class for doing read() and write() on a connected socket and installing and removing event handlers as appropriate. More...

#include <gsocketprotocol.h>

List of all members.

Public Types

typedef SocketProtocolSink Sink

Public Member Functions

 SocketProtocol (EventHandler &, Sink &, StreamSocket &)
 Constructor. The references are kept.
 ~SocketProtocol ()
 Destructor.
void readEvent ()
 Called on receipt of a read event.
bool writeEvent ()
 Called on receipt of a write event.
bool send (const std::string &data, std::string::size_type offset=0U)
 Sends data.
void sslConnect ()
 Initiates the SSL protocol.
void sslAccept ()
 Accepts the SSL protocol.
bool sslEnabled () const
 Returns true if SSL is active.

Static Public Member Functions

static bool sslCapable ()
 Returns true if the implementation supports SSL.


Detailed Description

A class for doing read() and write() on a connected socket and installing and removing event handlers as appropriate.

This abstraction allows for using SSL.

Definition at line 44 of file gsocketprotocol.h.


Member Typedef Documentation

Definition at line 47 of file gsocketprotocol.h.


Constructor & Destructor Documentation

GNet::SocketProtocol::SocketProtocol ( EventHandler handler,
Sink sink,
StreamSocket socket 
)

Constructor. The references are kept.

Definition at line 447 of file gsocketprotocol.cpp.

GNet::SocketProtocol::~SocketProtocol (  ) 

Destructor.

Definition at line 452 of file gsocketprotocol.cpp.


Member Function Documentation

void GNet::SocketProtocol::readEvent (  ) 

Called on receipt of a read event.

Delivers data via the sink interface. Throws ReadError on error.

Definition at line 457 of file gsocketprotocol.cpp.

References GNet::SocketProtocolImp::readEvent().

Referenced by GNet::ServerPeer::readEvent().

bool GNet::SocketProtocol::writeEvent (  ) 

Called on receipt of a write event.

Sends more pending data down the connection. Returns true if all pending data was sent. Throws SendError on error.

Definition at line 462 of file gsocketprotocol.cpp.

References GNet::SocketProtocolImp::writeEvent().

Referenced by GNet::ServerPeer::writeEvent().

bool GNet::SocketProtocol::send ( const std::string &  data,
std::string::size_type  offset = 0U 
)

Sends data.

Returns false if flow control asserted. Throws SendError on error.

Definition at line 467 of file gsocketprotocol.cpp.

References GNet::SocketProtocolImp::send().

Referenced by GNet::ServerPeer::send().

bool GNet::SocketProtocol::sslCapable (  )  [static]

Returns true if the implementation supports SSL.

Definition at line 472 of file gsocketprotocol.cpp.

References GSsl::Library::instance().

void GNet::SocketProtocol::sslConnect (  ) 

Initiates the SSL protocol.

Definition at line 477 of file gsocketprotocol.cpp.

References GNet::SocketProtocolImp::sslConnect().

void GNet::SocketProtocol::sslAccept (  ) 

Accepts the SSL protocol.

Definition at line 482 of file gsocketprotocol.cpp.

References GNet::SocketProtocolImp::sslAccept().

Referenced by GNet::ServerPeer::sslAccept().

bool GNet::SocketProtocol::sslEnabled (  )  const

Returns true if SSL is active.

Definition at line 487 of file gsocketprotocol.cpp.

References GNet::SocketProtocolImp::sslEnabled().


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

Generated on Fri Apr 18 15:56:13 2008 for E-MailRelay by  doxygen 1.5.5