Virtual I/O layer, only used with TCP/IP sockets at the moment. More...
#include <vio.h>
Public Member Functions | |
Vio (int sd) | |
int | close () |
size_t | read (unsigned char *buf, size_t size) |
size_t | write (const unsigned char *buf, size_t size) |
int | blocking (bool set_blocking_mode, bool *old_mode) |
int | fastsend () |
int32_t | keepalive (bool set_keep_alive) |
bool | should_retry () const |
bool | was_interrupted () const |
bool | peer_addr (char *buf, size_t buflen, uint16_t &port) const |
void | timeout (bool is_sndtimeo, int32_t timeout) |
int | get_errno () const |
int | get_fd () const |
Private Attributes | |
int | sd |
int | fcntl_mode |
Virtual I/O layer, only used with TCP/IP sockets at the moment.
drizzle_plugin::Vio::Vio | ( | int | sd | ) |
int drizzle_plugin::Vio::blocking | ( | bool | set_blocking_mode, |
bool * | old_mode | ||
) |
Set device blocking mode.
[in] | set_blocking_mode | Whether the device should block. true sets blocking mode, false clears it. |
[out] | old_mode | This will be set to the previous blocking mode. |
Definition at line 92 of file vio.cc.
Referenced by drizzle_plugin::drizzleclient_net_real_write().
int drizzle_plugin::Vio::close | ( | void | ) |
int drizzle_plugin::Vio::fastsend | ( | ) |
int drizzle_plugin::Vio::get_errno | ( | ) | const |
Returns the last error code.
Definition at line 189 of file vio.cc.
Referenced by drizzle_plugin::drizzleclient_net_real_write(), and drizzle_plugin::my_real_read().
int drizzle_plugin::Vio::get_fd | ( | ) | const |
Get the underlying descriptor this class is using.
Definition at line 194 of file vio.cc.
Referenced by drizzle_plugin::my_real_read().
int32_t drizzle_plugin::Vio::keepalive | ( | bool | set_keep_alive | ) |
bool drizzle_plugin::Vio::peer_addr | ( | char * | buf, |
size_t | buflen, | ||
uint16_t & | port | ||
) | const |
size_t drizzle_plugin::Vio::read | ( | unsigned char * | buf, |
size_t | size | ||
) |
Read some data from the remote end.
[out] | buf | A buffer to write the new data to. |
[in] | size | The size of the buffer |
Definition at line 82 of file vio.cc.
Referenced by drizzle_plugin::my_real_read().
bool drizzle_plugin::Vio::should_retry | ( | ) | const |
Definition at line 141 of file vio.cc.
Referenced by drizzle_plugin::drizzleclient_net_real_write(), and drizzle_plugin::my_real_read().
void drizzle_plugin::Vio::timeout | ( | bool | is_sndtimeo, |
int32_t | timeout | ||
) |
bool drizzle_plugin::Vio::was_interrupted | ( | ) | const |
Definition at line 147 of file vio.cc.
Referenced by drizzle_plugin::my_real_read().
size_t drizzle_plugin::Vio::write | ( | const unsigned char * | buf, |
size_t | size | ||
) |
Write some data to the remote end.
[in] | buf | A buffer that contains the data to send. |
[in] | size | The size of the buffer |
Definition at line 87 of file vio.cc.
Referenced by drizzle_plugin::drizzleclient_net_real_write().