feisty meow concerns codebase
2.140
|
#include <socket_minder.h>
Public Member Functions | |
socket_minder (processes::post_office &post, int parent_route, int event_type, int message) | |
virtual | ~socket_minder () |
void | disengage () |
DEFINE_CLASS_NAME ("socket_minder") | |
basis::astring | text_form () const |
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 (basis::int_array &read_sox, basis::int_array &write_sox, basis::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.
sockets::socket_minder::socket_minder | ( | processes::post_office & | post, |
int | parent_route, | ||
int | event_type, | ||
int | message | ||
) |
Definition at line 100 of file socket_minder.cpp.
References NULL_POINTER.
|
virtual |
Definition at line 116 of file socket_minder.cpp.
References basis::WHACK().
bool sockets::socket_minder::add_socket_data | ( | int | socket, |
bool | server, | ||
int | server_socket, | ||
bool | connected_mode, | ||
bool | connection_pending | ||
) |
Definition at line 247 of file socket_minder.cpp.
References sockets::socket_data::_connection_pending, lock_socket_data(), sockets::raw_socket::set_non_blocking(), and unlock_socket_data().
sockets::socket_minder::DEFINE_CLASS_NAME | ( | "socket_minder" | ) |
void sockets::socket_minder::disengage | ( | ) |
Definition at line 127 of file socket_minder.cpp.
|
virtual |
Definition at line 402 of file socket_minder.cpp.
References sockets::socket_data::_connection_pending, sockets::socket_data::_registered_interests, sockets::socket_data::_socket, FUNCDEF, handle_pending_connecters(), LOG, push_receives(), push_sends(), sockets::raw_socket::select(), sockets::SI_DISCONNECTED, and sockets::SI_ERRONEOUS.
Referenced by remove_socket_data().
int sockets::socket_minder::get_pending_server | ( | ) |
Definition at line 342 of file socket_minder.cpp.
References basis::array< contents >::get(), basis::array< contents >::length(), and basis::array< contents >::zap().
void sockets::socket_minder::get_sockets | ( | basis::int_array & | read_sox, |
basis::int_array & | write_sox, | ||
basis::int_array & | pending | ||
) | const |
Definition at line 201 of file socket_minder.cpp.
References sockets::socket_data::_connection_pending, sockets::socket_data::_partially_sent, sockets::socket_data::_socket, and basis::array< contents >::length().
Referenced by snoozy_select().
bool sockets::socket_minder::handle_pending_connecters | ( | socket_data & | to_peek | ) |
Definition at line 351 of file socket_minder.cpp.
References sockets::socket_data::_connection_pending, sockets::socket_data::_is_server, sockets::socket_data::_last_conn_alert, sockets::socket_data::_registered_interests, sockets::socket_data::_socket, sockets::CONN_ALERT_INTERVAL, FUNCDEF, INVALID_SOCKET, basis::array< contents >::length(), LOG, structures::set< contents >::member(), timely::time_stamp::reset(), and sockets::SI_CONNECTED.
Referenced by evaluate_interest(), and snoozy_select().
bool sockets::socket_minder::is_connection_pending | ( | int | socket | ) |
Definition at line 298 of file socket_minder.cpp.
References sockets::socket_data::_connection_pending, lock_socket_data(), and unlock_socket_data().
socket_data * sockets::socket_minder::lock_socket_data | ( | int | socket | ) |
Definition at line 229 of file socket_minder.cpp.
References basis::mutex::lock(), NULL_POINTER, and basis::mutex::unlock().
Referenced by add_socket_data(), is_connection_pending(), register_interest(), set_connection_pending(), and snoozy_select().
bool sockets::socket_minder::owns_socket | ( | int | socket | ) | const |
Definition at line 220 of file socket_minder.cpp.
Referenced by snoozy_select().
void sockets::socket_minder::push_receives | ( | socket_data & | to_poke, |
int | states | ||
) |
Definition at line 502 of file socket_minder.cpp.
References sockets::socket_data::_connected_mode, sockets::socket_data::_connection_pending, sockets::socket_data::_partially_received, sockets::socket_data::_partially_sent, sockets::socket_data::_receive_buffer, sockets::socket_data::_socket, sockets::raw_socket::close(), FUNCDEF, basis::array< contents >::last(), basis::array< contents >::length(), LOG, sockets::MAXIMUM_TRANSFER_CHUNK, basis::array< contents >::observe(), basis::array< contents >::reset(), basis::astring::s(), sockets::raw_socket::select(), sockets::raw_socket::SELECTING_JUST_READ, sockets::SI_DISCONNECTED, sockets::SI_READABLE, SOCK_ECONNABORTED, SOCK_ECONNRESET, SOCK_ENOTSOCK, SOCK_EWOULDBLOCK, sockets::SOCKMIND_MAXIMUM_RECEIVES, sockets::tcpip_stack::tcpip_error_name(), and basis::array< contents >::zap().
Referenced by evaluate_interest(), and snoozy_select().
void sockets::socket_minder::push_sends | ( | socket_data & | to_poke, |
int | states | ||
) |
Definition at line 440 of file socket_minder.cpp.
References sockets::socket_data::_connection_pending, sockets::socket_data::_partially_sent, sockets::socket_data::_socket, FUNCDEF, basis::array< contents >::length(), LOG, basis::array< contents >::observe(), basis::array< contents >::reset(), basis::astring::s(), sockets::SI_DISCONNECTED, sockets::SI_WRITABLE, SOCK_ECONNABORTED, SOCK_ECONNRESET, SOCK_ENOTSOCK, SOCK_EWOULDBLOCK, SOCKET_ERROR, sockets::tcpip_stack::tcpip_error_name(), and basis::array< contents >::zap().
Referenced by evaluate_interest(), and snoozy_select().
void sockets::socket_minder::put_pending_server | ( | int | to_put, |
bool | at_head | ||
) |
Definition at line 322 of file socket_minder.cpp.
References basis::array< contents >::insert().
bool sockets::socket_minder::register_interest | ( | int | socket, |
int | interests | ||
) |
Definition at line 282 of file socket_minder.cpp.
References sockets::socket_data::_registered_interests, FUNCDEF, lock_socket_data(), LOG, and unlock_socket_data().
bool sockets::socket_minder::remove_socket_data | ( | int | socket | ) |
Definition at line 266 of file socket_minder.cpp.
References evaluate_interest(), and FUNCDEF.
bool sockets::socket_minder::set_connection_pending | ( | int | socket, |
bool | pending | ||
) |
Definition at line 307 of file socket_minder.cpp.
References sockets::socket_data::_connection_pending, lock_socket_data(), and unlock_socket_data().
void sockets::socket_minder::snoozy_select | ( | ) |
Definition at line 147 of file socket_minder.cpp.
References FUNCDEF, get_sockets(), handle_pending_connecters(), basis::array< contents >::length(), lock_socket_data(), sockets::MULTI_SELECT_TIMEOUT, owns_socket(), push_receives(), push_sends(), sockets::raw_socket::select(), sockets::SI_READABLE, sockets::SI_WRITABLE, unlock_socket_data(), and basis::array< contents >::zap().
astring sockets::socket_minder::text_form | ( | ) | const |
Definition at line 132 of file socket_minder.cpp.
References sockets::socket_data::text_form().
void sockets::socket_minder::unlock_socket_data | ( | socket_data * | to_unlock | ) |
Definition at line 240 of file socket_minder.cpp.
References basis::mutex::unlock().
Referenced by add_socket_data(), is_connection_pending(), register_interest(), set_connection_pending(), and snoozy_select().
bool sockets::socket_minder::zap_pending_server | ( | int | socket | ) |
Definition at line 334 of file socket_minder.cpp.
References structures::set< contents >::member(), and structures::set< contents >::remove().