Main Page   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields  

sword::InetClient Class Reference

A Internet service client. More...


Public Methods

 InetClient ()
 Creates the Inet client (do not establish connection yet).

 InetClient (const std::string &host, word port)
 Creates the Inet client (and establishes the connection).

 ~InetClient ()
 Deletes the Inet client (and disconnects from the server).

void open (const std::string &host, word port)
 Connects to the server.

std::string readLine ()
 Read a text line from the server.

void writeLine (const std::string &line)
 Write a text to the server.

word InetClient::readRaw (void *buffer, word length)
 Read binary data from the server.

void InetClient::writeRaw (const void *buffer, word length)
 Write binary data to the server.


Detailed Description

A Internet service client.

This class implements the basics for a internet service client such as Http, Smtp, Nntp... It assumes that all those protocols are basically text-based and line-oriented. They exchange information between the client and the server using lines of text most of the time, and opaque binary data in few occasions.


Constructor & Destructor Documentation

sword::InetClient::InetClient  
 

Creates the Inet client (do not establish connection yet).

sword::InetClient::InetClient const std::string &    host,
word    port
 

Creates the Inet client (and establishes the connection).

sword::InetClient::~InetClient  
 

Deletes the Inet client (and disconnects from the server).


Member Function Documentation

word sword::InetClient::InetClient::readRaw void *    buffer,
word    length
 

Read binary data from the server.

void sword::InetClient::InetClient::writeRaw const void *    buffer,
word    length
 

Write binary data to the server.

void sword::InetClient::open const std::string &    host,
word    port
 

Connects to the server.

std::string sword::InetClient::readLine  
 

Read a text line from the server.

The line obtained does not contain the end-of-line marker.

void sword::InetClient::writeLine const std::string &    line
 

Write a text to the server.

The line sent must not contain the end-of-line marker.


Generated on Tue Dec 23 20:08:57 2003 for SWORD by doxygen1.3-rc2