|
VMime
|
#include <socket.hpp>


Public Types | |
| enum | Status { STATUS_WOULDBLOCK = 0xf , STATUS_WANT_READ = 0x1 , STATUS_WANT_WRITE = 0x2 } |
Public Member Functions | |
| virtual | ~socket () |
| virtual void | connect (const string &address, const port_t port)=0 |
| virtual void | disconnect ()=0 |
| virtual bool | isConnected () const =0 |
| virtual bool | waitForRead (const int msecs=30000)=0 |
| virtual bool | waitForWrite (const int msecs=30000)=0 |
| virtual void | receive (string &buffer)=0 |
| virtual size_t | receiveRaw (byte_t *buffer, const size_t count)=0 |
| virtual void | send (const string &buffer)=0 |
| virtual void | send (const char *str)=0 |
| virtual void | sendRaw (const byte_t *buffer, const size_t count)=0 |
| virtual size_t | sendRawNonBlocking (const byte_t *buffer, const size_t count)=0 |
| virtual size_t | getBlockSize () const =0 |
| virtual unsigned int | getStatus () const =0 |
| virtual const string | getPeerName () const =0 |
| virtual const string | getPeerAddress () const =0 |
| virtual shared_ptr< timeoutHandler > | getTimeoutHandler ()=0 |
| virtual void | setTracer (shared_ptr< tracer > tracer)=0 |
| virtual shared_ptr< tracer > | getTracer ()=0 |
Protected Member Functions | |
| socket () | |
Protected Member Functions inherited from object | |
| object () | |
| object (const object &) | |
| object & | operator= (const object &) |
| virtual | ~object () |
Interface for connecting to servers.
|
protected |
Connect to the specified address and port.
| address | server address (this can be a full qualified domain name or an IP address, doesn't matter) |
| port | server port |
Implemented in SASLSocket.
Disconnect from the server.
Implemented in SASLSocket.
Return the preferred maximum block size when reading from or writing to this stream.
Implemented in SASLSocket.
Referenced by inputStreamSocketAdapter::getBlockSize(), and outputStreamSocketAdapter::getBlockSize().
Return the address of peer this socket is connected to.
Implemented in SASLSocket.
Return the hostname of peer this socket is connected to.
Implemented in SASLSocket.
Return the current status of this socket.
Implemented in SASLSocket.
|
pure virtual |
Return the timeout handler associated with this socket.
Implemented in SASLSocket.
|
pure virtual |
Return the tracer used by this socket.
Implemented in SASLSocket.
Test whether this socket is connected.
Implemented in SASLSocket.
Receive text data from the socket.
| buffer | buffer in which to write received data |
Implemented in SASLSocket.
Receive raw data from the socket.
| buffer | buffer in which to write received data |
| count | maximum number of bytes to receive (size of buffer) |
Implemented in SASLSocket.
Referenced by inputStreamSocketAdapter::read().
Send raw data to the socket.
| buffer | data to send |
| count | number of bytes to send (size of buffer) |
Implemented in SASLSocket.
Referenced by outputStreamSocketAdapter::writeImpl().
Send raw data to the socket.
Function may returns before all data is sent.
| buffer | data to send |
| count | number of bytes to send (size of buffer) |
Implemented in SASLSocket.
|
pure virtual |
Set the tracer used by this socket.
Tracer will only be used to report socket-specific events such as connection (not when sending/receiving data).
| tracer | tracer to use |
Block until new data is available for reading.
The function will timeout after msecs milliseconds.
| timeout | maximum wait time, in milliseconds (default is 30000); resolution is 10ms |
Implemented in SASLSocket.
Block until pending data has been written and new data can be written.
The function will timeout after msecs milliseconds.
| timeout | maximum wait time, in milliseconds (default is 30000); resolution is 10ms |
Implemented in SASLSocket.