#include <filedescriptor.h>
Public Types | |
typedef ConexusPointer < FileDescriptor > | pointer |
Public Member Functions | |
virtual | ~FileDescriptor () |
virtual int | fd () throw () |
Base class method returning the raw file descriptor. | |
virtual void | close (bool force=false) throw ( close_exception ) |
Closes the Endpoint object by closing the member file descriptor. | |
bool | is_blocking () |
bool | set_blocking (bool block=true) |
Protected Member Functions | |
FileDescriptor (int fd=-1, bool close_on_destruct=true) | |
virtual size_t | write_data (const Data data, Timeout to) throw ( write_exception ) |
virtual Data | read_data (size_t s, Timeout to) throw ( read_exception ) |
Protected Attributes | |
int | m_fd |
typedef ConexusPointer<FileDescriptor> Conexus::FileDescriptor::pointer |
Reimplemented from Conexus::Endpoint.
Reimplemented in Conexus::File, Conexus::IP, Conexus::IPv4::IP, Conexus::IPv4::TCP, Conexus::IPv4::UDP, Conexus::IPv4::UDPPoset, Conexus::IPv6::IP, Conexus::IPv6::TCP, Conexus::IPv6::UDP, Conexus::IPv6::UDPPoset, Conexus::LL::Packet, Conexus::Pipe, Conexus::Serial, Conexus::Socket, Conexus::TTY, Conexus::SSL::IPv4::TCP, Conexus::SSL::IPv4::UDP, and Conexus::SSL::IPv6::TCP.
Conexus::FileDescriptor::FileDescriptor | ( | int | fd = -1 , |
|
bool | close_on_destruct = true | |||
) | [protected] |
Conexus::FileDescriptor::~FileDescriptor | ( | ) | [virtual] |
References close(), Conexus::Endpoint::is_open(), and Conexus::Endpoint::m_close_on_destruct.
void Conexus::FileDescriptor::close | ( | bool | force = false |
) | throw ( close_exception ) [virtual] |
Closes the Endpoint object by closing the member file descriptor.
If the object is already closed will return without attempting to close.
Implements Conexus::Endpoint.
Reimplemented in Conexus::Pipe, Conexus::Socket, and Conexus::TTY.
References Conexus::throw_close_exception().
Referenced by Conexus::TTY::close(), and ~FileDescriptor().
int Conexus::FileDescriptor::fd | ( | ) | throw () [virtual] |
bool Conexus::FileDescriptor::is_blocking | ( | ) |
References Conexus::Endpoint::is_open(), and m_fd.
Data Conexus::FileDescriptor::read_data | ( | size_t | s, | |
Timeout | to | |||
) | throw ( read_exception ) [protected, virtual] |
Implements Conexus::Endpoint.
Reimplemented in Conexus::File, Conexus::Pipe, Conexus::Socket, Conexus::SSL::IPv4::TCP, Conexus::SSL::IPv4::UDP, and Conexus::SSL::IPv6::TCP.
References Conexus::throw_read_exception().
Referenced by Conexus::Socket::read_data(), Conexus::Pipe::read_data(), and Conexus::File::read_data().
bool Conexus::FileDescriptor::set_blocking | ( | bool | block = true |
) |
References Conexus::Endpoint::is_open(), m_fd, and Conexus::throw_write_exception().
size_t Conexus::FileDescriptor::write_data | ( | const Data | data, | |
Timeout | to | |||
) | throw ( write_exception ) [protected, virtual] |
Implements Conexus::Endpoint.
Reimplemented in Conexus::IPv4::TCP, Conexus::IPv4::UDP, Conexus::IPv4::UDPPoset, Conexus::IPv6::TCP, Conexus::IPv6::UDP, Conexus::IPv6::UDPPoset, Conexus::LL::Packet, Conexus::Pipe, Conexus::Socket, Conexus::SSL::IPv4::TCP, Conexus::SSL::IPv4::UDP, and Conexus::SSL::IPv6::TCP.
References Conexus::throw_write_exception().
Referenced by Conexus::Socket::write_data().
int Conexus::FileDescriptor::m_fd [protected] |
Referenced by Conexus::TTY::drain(), fd(), Conexus::TTY::flush(), Conexus::TTY::flush_input(), Conexus::TTY::flush_output(), Conexus::TTY::inject(), Conexus::TTY::input_available(), Conexus::IPv6::UDP::input_available(), Conexus::IPv6::TCP::input_available(), Conexus::IPv4::UDP::input_available(), Conexus::IPv4::TCP::input_available(), Conexus::LL::Packet::interface_index(), Conexus::LL::Packet::interface_name(), Conexus::LL::Packet::interface_names(), is_blocking(), Conexus::IPv4::UDP::join(), Conexus::Socket::listen(), Conexus::Socket::open(), Conexus::Pipe::open(), Conexus::SSL::IPv6::TCP::open(), Conexus::SSL::IPv4::UDP::open(), Conexus::SSL::IPv4::TCP::open(), Conexus::Socket::option(), Conexus::IPv6::UDP::output_pending(), Conexus::IPv4::UDP::output_pending(), Conexus::IPv6::TCP::pending_output_size(), Conexus::IPv4::TCP::pending_output_size(), Conexus::TTY::restart_input(), Conexus::TTY::restart_output(), set_blocking(), Conexus::LL::Packet::set_interface(), Conexus::Socket::set_option(), Conexus::IPv6::TCP::shutdown(), Conexus::IPv4::TCP::shutdown(), Conexus::TTY::suspend_input(), Conexus::TTY::suspend_output(), Conexus::SSL::IPv6::TCP::TCP(), Conexus::IPv6::TCP::TCP(), Conexus::SSL::IPv4::TCP::TCP(), Conexus::IPv4::TCP::TCP(), Conexus::TTY::tcsetattr(), and Conexus::TTY::~TTY().