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

Ishtar::NetworkClient Class Reference

#include <network.h>

List of all members.


Detailed Description

A client that connect to a TCP/IP host. User code subclass should inherits from NetworkClient and implement incomingData and ocnnectionClosed.


Public Member Functions

 NetworkClient (const std::string &host, UInt16 port)
 Constructor. Create socket and connects to host on port.
virtual ~NetworkClient ()
 Destructor, close connection and destroy socket.
void run (void)
 Run and return only when connection is closed.
bool step (bool block=false, long timeout=0)
 Read data from socket and call incomingData. If block is true, wait until any data arrives. If block is false, wait timeout us at maximum.

Protected Member Functions

virtual void incomingData (Socket *socket)=0
 Called when datas are available on socket. If socket is closed in this method, connectionClosed is called. Must be implemented by subclass.
virtual void connectionClosed (Socket *socket)=0
 Called when connection is closed on socket. Must be implemented by subclass.

Protected Attributes

Socketsocket
 The socket that connect to the server.


The documentation for this class was generated from the following files:
Generated on Mon Oct 24 17:30:54 2005 for libishtarnet by  doxygen 1.4.2