#include <MAUtil/Connection.h>
Inheritance diagram for MAUtil::Connection:

Public Member Functions | |
| Connection (ConnectionListener *listener) | |
| virtual | ~Connection () |
| int | connect (const char *url) |
| void | close () |
| void | write (const void *src, int len) |
| void | writeFromData (MAHandle data, int offset, int len) |
| void | recv (void *dst, int maxlen) |
| void | recvToData (MAHandle data, int offset, int maxlen) |
| void | read (void *dst, int len) |
| void | readToData (MAHandle data, int offset, int len) |
| void | setListener (ConnectionListener *listener) |
| bool | isOpen () const |
Protected Member Functions | |
| void | recvMem (int prevRes) |
| void | recvData (int prevRes) |
| virtual void | connEvent (const MAConnEventData &data) |
Protected Attributes | |
| MAHandle | mConn |
| ConnectionListener * | mListener |
| int | mRemain |
| byte * | mDst |
| MAHandle | mData |
| int | mOffset |
| void(Connection::* | mRecv )(int prevRes) |
|
|
Initializes the new Connection with the specified ConnectionListener. |
|
|
Closes the connection, if open.
|
|
|
|
|
|
Closes the connection, if open. Frees all resources allocated by this object. Allows this Connection object to be reused for further connections.
|
|
||||||||||||
|
Causes ConnectionListener::connWriteFinished() to be called when the operation is complete.
|
|
||||||||||||||||
|
Causes ConnectionListener::connWriteFinished() to be called when the operation is complete.
|
|
||||||||||||
|
Reads between 1 and maxlen bytes to dst. Causes ConnectionListener::connRecvFinished() to be called when the operation is complete. Use this function when you don't care how much data you get, as long as you get something. |
|
||||||||||||||||
|
Reads between 1 and maxlen bytes to data, starting at offset. Causes ConnectionListener::connRecvFinished() to be called when the operation is complete. |
|
||||||||||||
|
Reads exactly len bytes to dst. Causes ConnectionListener::connReadFinished() to be called when the operation is complete. Use this function when you know exactly how much data you want, and are not interested in anything less. |
|
||||||||||||||||
|
Reads exactly len bytes to data, starting at offset. Causes ConnectionListener::connReadFinished() to be called when the operation is complete. |
|
|
Replaces the listener for this object.
|
|
|
Returns true if the connection is open, false otherwise. The connection is considered open even during the connect() operation. |
|
|
|
|
|
|
|
|
Implements MAUtil::ConnListener. Reimplemented in MAUtil::HttpConnection. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1.4.6-NO