#include <socket_minder.h>
Inheritance diagram for socket_minder:


Public Member Functions | |
| socket_minder (post_office &post, int parent_route, int event_type, int message) | |
| virtual | ~socket_minder () |
| void | disengage () |
| IMPLEMENT_CLASS_NAME ("socket_minder") | |
| istring | text_form () const |
| Provides a text view of all the important info owned by this object. | |
| socket_data * | lock_socket_data (int socket) |
| void | unlock_socket_data (socket_data *to_unlock) |
| bool | add_socket_data (int socket, bool server, int server_socket, bool connected_mode, bool connection_pending) |
| bool | remove_socket_data (int socket) |
| bool | set_connection_pending (int socket, bool pending) |
| bool | is_connection_pending (int socket) |
| bool | register_interest (int socket, int interests) |
| virtual bool | evaluate_interest (socket_data &to_examine) |
| int | get_pending_server () |
| bool | zap_pending_server (int socket) |
| void | put_pending_server (int to_put, bool at_head) |
| void | get_sockets (int_array &read_sox, int_array &write_sox, int_array &pending) const |
| bool | owns_socket (int socket) const |
| void | push_sends (socket_data &to_poke, int states) |
| void | push_receives (socket_data &to_poke, int states) |
| bool | handle_pending_connecters (socket_data &to_peek) |
| void | snoozy_select () |
Definition at line 40 of file socket_minder.h.
| socket_minder::socket_minder | ( | post_office & | post, | |
| int | parent_route, | |||
| int | event_type, | |||
| int | message | |||
| ) |
| socket_minder::~socket_minder | ( | ) | [virtual] |
| void socket_minder::disengage | ( | ) |
Definition at line 122 of file socket_minder.cpp.
| socket_minder::IMPLEMENT_CLASS_NAME | ( | "socket_minder" | ) |
| istring socket_minder::text_form | ( | ) | const [virtual] |
Provides a text view of all the important info owned by this object.
It is understood that there could be a large amount of information and that this function might take a relatively long time to complete. The information can be provided in multiple lines if desired (it is good to use log_base::platform_ending() for the line breaks to help to ensure that the text is formatted appropriately). the default is quite lame and should be overridden.
Reimplemented from object_base.
Definition at line 127 of file socket_minder.cpp.
References log_base::platform_ending().
| socket_data * socket_minder::lock_socket_data | ( | int | socket | ) |
Definition at line 224 of file socket_minder.cpp.
References mutex_base::lock(), NIL, and mutex_base::unlock().
Referenced by add_socket_data(), is_connection_pending(), register_interest(), set_connection_pending(), and snoozy_select().
| void socket_minder::unlock_socket_data | ( | socket_data * | to_unlock | ) |
Definition at line 235 of file socket_minder.cpp.
References mutex_base::unlock().
Referenced by add_socket_data(), is_connection_pending(), register_interest(), set_connection_pending(), and snoozy_select().
| bool socket_minder::add_socket_data | ( | int | socket, | |
| bool | server, | |||
| int | server_socket, | |||
| bool | connected_mode, | |||
| bool | connection_pending | |||
| ) |
Definition at line 242 of file socket_minder.cpp.
References socket_data::_connection_pending, lock_socket_data(), raw_socket::set_non_blocking(), and unlock_socket_data().
| bool socket_minder::remove_socket_data | ( | int | socket | ) |
| bool socket_minder::set_connection_pending | ( | int | socket, | |
| bool | pending | |||
| ) |
Definition at line 300 of file socket_minder.cpp.
References socket_data::_connection_pending, lock_socket_data(), and unlock_socket_data().
| bool socket_minder::is_connection_pending | ( | int | socket | ) |
Definition at line 291 of file socket_minder.cpp.
References socket_data::_connection_pending, lock_socket_data(), and unlock_socket_data().
| bool socket_minder::register_interest | ( | int | socket, | |
| int | interests | |||
| ) |
Definition at line 277 of file socket_minder.cpp.
References socket_data::_registered_interests, FUNCDEF, lock_socket_data(), LOG, istring::SPRINTF, and unlock_socket_data().
| bool socket_minder::evaluate_interest | ( | socket_data & | to_examine | ) | [virtual] |
Definition at line 395 of file socket_minder.cpp.
References socket_data::_connection_pending, socket_data::_registered_interests, socket_data::_socket, FUNCDEF, handle_pending_connecters(), LOG, push_receives(), push_sends(), raw_socket::select(), SI_DISCONNECTED, and SI_ERRONEOUS.
Referenced by remove_socket_data().
| int socket_minder::get_pending_server | ( | ) |
Definition at line 335 of file socket_minder.cpp.
References array< contents >::get(), array< contents >::length(), and array< contents >::zap().
| bool socket_minder::zap_pending_server | ( | int | socket | ) |
Definition at line 327 of file socket_minder.cpp.
References basis::set< contents >::member(), and basis::set< contents >::remove().
| void socket_minder::put_pending_server | ( | int | to_put, | |
| bool | at_head | |||
| ) |
| bool socket_minder::owns_socket | ( | int | socket | ) | const |
| void socket_minder::push_sends | ( | socket_data & | to_poke, | |
| int | states | |||
| ) |
Definition at line 433 of file socket_minder.cpp.
References socket_data::_connection_pending, socket_data::_partially_sent, socket_data::_socket, FUNCDEF, array< contents >::length(), LOG, array< contents >::reset(), istring::s(), SI_DISCONNECTED, SI_WRITABLE, SOCK_ECONNABORTED, SOCK_ECONNRESET, SOCK_ENOTSOCK, SOCK_EWOULDBLOCK, SOCKET_ERROR, istring::SPRINTF, portable::system_error(), and tcpip_stack::tcpip_error_name().
Referenced by evaluate_interest(), and snoozy_select().
| void socket_minder::push_receives | ( | socket_data & | to_poke, | |
| int | states | |||
| ) |
Definition at line 495 of file socket_minder.cpp.
References socket_data::_connected_mode, socket_data::_connection_pending, socket_data::_partially_received, socket_data::_partially_sent, socket_data::_receive_buffer, socket_data::_socket, FUNCDEF, array< contents >::last(), array< contents >::length(), LOG, MAXIMUM_TRANSFER_CHUNK, array< contents >::observe(), array< contents >::reset(), istring::s(), raw_socket::select(), raw_socket::SELECTING_JUST_READ, SI_DISCONNECTED, SI_READABLE, SOCK_ECONNABORTED, SOCK_ECONNRESET, SOCK_ENOTSOCK, SOCK_EWOULDBLOCK, SOCKMIND_MAXIMUM_RECEIVES, istring::SPRINTF, portable::system_error(), tcpip_stack::tcpip_error_name(), and array< contents >::zap().
Referenced by evaluate_interest(), and snoozy_select().
| bool socket_minder::handle_pending_connecters | ( | socket_data & | to_peek | ) |
Definition at line 344 of file socket_minder.cpp.
References socket_data::_connection_pending, socket_data::_is_server, socket_data::_last_conn_alert, socket_data::_registered_interests, socket_data::_socket, CONN_ALERT_INTERVAL, FUNCDEF, INVALID_SOCKET, array< contents >::length(), LOG, basis::set< contents >::member(), time_stamp::reset(), and SI_CONNECTED.
Referenced by evaluate_interest(), and snoozy_select().
| void socket_minder::snoozy_select | ( | ) |
Definition at line 142 of file socket_minder.cpp.
References FUNCDEF, get_sockets(), handle_pending_connecters(), array< contents >::length(), lock_socket_data(), MULTI_SELECT_TIMEOUT, owns_socket(), push_receives(), push_sends(), raw_socket::select(), SI_READABLE, SI_WRITABLE, unlock_socket_data(), and array< contents >::zap().
1.5.1