Public Member Functions |
std::string & | you_there () |
| Return the string that is used in reply to ARE_YOU_THERE requests.
|
void | listen_unix (std::string const &file, listen_t cb, unsigned queue=10) |
| Listen for new connections on a UNIX socket. Use listen instead.
|
void | listen_tcp (std::string const &service, listen_t cb, unsigned queue=10) |
| Listen for new connections on a TCP socket. Use listen instead.
|
void | listen_avahi (std::string const &service, Glib::ustring const &protocol, Glib::ustring const &name, listen_t cb, unsigned queue=10) |
| Listen for new connections on a TCP socket, and register it with avahi. Use listen instead.
|
void | listen (std::string const &port, listen_t cb, unsigned queue=10) |
| Listen for new connections.
|
void | connect_unix (std::string const &unix_name) |
| Connect to a UNIX socket. Use connect instead.
|
void | connect_tcp (std::string const &host, std::string const &service) |
| Connect to a TCP socket. Use connect instead.
|
void | connect_avahi (avahi::browser::owner const &target, avahi::browser::details const &details=avahi::browser::details()) |
| Connect to an avahi TCP socket. Use connect instead.
|
void | connect (std::string const &port) |
| Connect to a socket.
|
void | accept (Glib::RefPtr< socket > sock) |
| Accept a connection (only allowed on a listening socket).
|
std::string | get_peer_info (bool numeric=false) const |
| Get information about the other side of a connection.
|
std::string | get_own_info (bool numeric=false) const |
| Get info about our side of the connection.
|
disconnect_t | signal_disconnect () |
| Schedule a function to be called when the socket is disconnected.
|
void | disconnect () |
| Disconnect the socket without reconnecting.
|
void | read_custom (read_custom_t cb) |
| Poll for read with a custom callback to poll.
|
void | read_priority_custom (read_custom_t cb) |
| Poll for priority read with a custom callback to poll.
|
void | read (read_t cb) |
| Poll for read and set read callback (resets custom callback)
|
void | read_priority (read_t cb) |
| Poll for priority read and set read callback (resets custom callback)
|
void | read_lines (read_lines_t cb) |
| Poll for read and set read lines callback (resets custom and read callback). Polls for priority read as well.
|
void | unread (bool flush_buffer=false, flush_t cb=flush_t()) |
| Stop polling for read (including priority read).
|
void | write (std::string const &data, write_done_t cb=write_done_t()) |
| Write data and set a callback (defaults to none).
|
void | write_raw (std::string const &data, write_done_t cb=write_done_t()) |
| Write data, ignoring the filter, and set a callback (defaults to none).
|
bool | write_block (relative_time timeout=relative_time(-1, 0)) |
| Block until write buffer is empty.
|
std::string & | read_block (relative_time timeout=relative_time(-1, 0)) |
| Block until data is read, try writing if there is a write buffer.
|
std::string | read_line_block (relative_time timeout=relative_time(-1, 0)) |
| Call read_block until a line has been read, or the timeout expires.
|
void | set_fd (int fd) |
| Change file descriptor.
|
void | in_filter (filter_t cb) |
| If set, incoming data is filtered through this callback before it is put into the buffer.
|
void | out_filter (filter_t cb) |
| If set, outgoing data is filtered through this callback before it is sent to the file descriptor.
|
void | set_error (error_t cb) |
| Set a callback for all error types at once.
|
void | set_poll_error (error_t cb) |
| Callback for errors from poll.
|
void | set_read_error (error_t cb) |
| Callback for errors from read.
|
void | set_write_error (error_t cb) |
| Callback for errors from write.
|
void | set_eof (error_t cb) |
| Callback for end of file.
|
void | read_reset () |
| Stop reading, delete the buffer.
|
void | write_reset () |
| Stop writing, delete the buffer.
|
void | reset () |
| Stop reading and writing, delete the buffers.
|
int | get_fd () const |
| Get the fd. This function should mostly be used by derived classes.
|
Glib::RefPtr< Glib::MainContext > | get_main_context () |
| Get the main context. Also mostly used by derived classes.
|
template<typename _T > |
Glib::RefPtr< _T > | cast_dynamic () |
| Identical to GLib::RefPtr <>::cast_dynamic, but nicer to type.
|
Input and output filters for shevek::socket to make them telnet sockets.