#include <basenetwork.h>
Collaboration diagram for GNUMessenger::Network:

Public Types | |
| enum | Error { ERROR_NETWORK_NOERROR = 101, ERROR_NETWORK_INVOP, ERROR_NETWORK_IOERR, ERROR_NETWORK_INVADDR, ERROR_NETWORK_INVSOCK, ERROR_NETWORK_NOHOST, ERROR_NETWORK_INVPORT, ERROR_NETWORK_WOULDBLOCK, ERROR_NETWORK_TIMEDOUT, ERROR_NETWORK_MEMERR, ERROR_NETWORK_UNKNOWNERR, ERROR_NETWORK_ALLOCERR } |
| Low-Level Network Error Codes. More... | |
| enum | Status { Connected, Closed, HostLookupFailure, ConnectionRefused, FailedRead, FailedWrite, NotConnected } |
| Network status. | |
Public Member Functions | |
| Network (Protocol *owner) | |
| Constructor, associates a Protocol with this network. | |
| virtual void | connectTo (const string &host, unsigned int port)=0 |
| Tries to connect to a given host. | |
| virtual string | getRemoteIP ()=0 |
| Return the IP of the remote host if we are connected, empty string otherwise. | |
| virtual bool | isConnected ()=0 |
| Checks to see if connection established. | |
| virtual unsigned long | availableData ()=0 |
| Return how much available data there is waiting to be read. | |
| virtual Status | status () |
| Return status. | |
| virtual void | sendData (const char *data, unsigned long len)=0 |
| Send data in a variety of ways. | |
| virtual void | sendData (const string &data) |
| virtual void | sendData (const XMLNode &data) |
| virtual void | sendData (const VBuffer &data)=0 |
| virtual void | disconnect ()=0 |
| Disconnect, never throws. | |
| virtual void | socketData (byte *&data, unsigned int &len)=0 |
| Call to retrieve all data available. | |
| virtual void | socketData (string &data)=0 |
| virtual void | socketData (VBuffer &data)=0 |
| virtual void | checkForData ()=0 |
| Update socket and check for data. | |
| virtual int | getSock ()=0 |
| Return socket handle. | |
| virtual void | setOwner (Protocol *protocol) |
| Set our owner. The protocol instance we should pass all incoming data to. | |
| unsigned long | getSentBytes () const |
| unsigned long | getSentPackets () const |
| unsigned long | getRecvBytes () const |
| unsigned long | getRecvPackets () const |
| virtual string | getHTTP (const string &url)=0 |
Static Public Member Functions | |
| template<typename T> T | NBO (const T &in) |
| Network Byte Order paramatrized function. | |
Protected Attributes | |
| unsigned long | m_sentBytes |
| unsigned long | m_recvBytes |
| unsigned long | m_sentPackets |
| unsigned long | m_recvPackets |
| Protocol * | m_owner |
| Status | m_status |
Jesse Lovelace
Definition at line 48 of file basenetwork.h.
|
|
Low-Level Network Error Codes.
|
|
||||||||||||
|
Tries to connect to a given host.
Referenced by GNUMessenger::TocProtocol::login(). |
|
|
Checks to see if connection established.
|
|
||||||||||
|
Network Byte Order paramatrized function.
|
|
||||||||||||
|
Send data in a variety of ways.
Referenced by GNUMessenger::TocProtocol::connectedToServer(). |
1.3.8