#include <P_UnixNetVConnection.h>
Inherits NetVConnection.
Inherited by SSLNetVConnection.
Public Member Functions | |
virtual VIO * | do_io_read (Continuation *c, int64_t nbytes, MIOBuffer *buf) |
Initiates read. | |
virtual VIO * | do_io_write (Continuation *c, int64_t nbytes, IOBufferReader *buf, bool owner=false) |
Initiates write. | |
virtual bool | get_data (int id, void *data) |
Convenience function to retrieve information from VConnection. | |
virtual Action * | send_OOB (Continuation *cont, char *buf, int len) |
Sends out of band messages over the connection. | |
virtual void | cancel_OOB () |
Cancels a scheduled send_OOB. | |
virtual void | setSSLHandshakeWantsRead (bool) |
virtual bool | getSSLHandshakeWantsRead () |
virtual void | setSSLHandshakeWantsWrite (bool) |
virtual bool | getSSLHandshakeWantsWrite () |
virtual void | do_io_close (int lerrno=-1) |
Closes the vconnection. | |
virtual void | do_io_shutdown (ShutdownHowTo_t howto) |
Shuts down read side, write side, or both. | |
virtual void | set_active_timeout (ink_hrtime timeout_in) |
Sets time after which SM should be notified. | |
virtual void | set_inactivity_timeout (ink_hrtime timeout_in) |
Sets time after which SM should be notified if the requested IO could not be performed. | |
virtual void | cancel_active_timeout () |
Clears the active timeout. | |
virtual void | cancel_inactivity_timeout () |
Clears the inactivity timeout. | |
virtual void | reenable (VIO *vio) |
PRIVATE: The public interface is VIO::reenable(). | |
virtual void | reenable_re (VIO *vio) |
PRIVATE: The public interface is VIO::reenable(). | |
virtual SOCKET | get_socket () |
virtual | ~UnixNetVConnection () |
UnixNetVConnection () | |
void | set_enabled (VIO *vio) |
void | get_local_sa () |
virtual int | sslStartHandShake (int event, int &err) |
virtual bool | getSSLHandShakeComplete () |
virtual bool | getSSLClientConnection () |
virtual void | setSSLClientConnection (bool state) |
virtual void | net_read_io (NetHandler *nh, EThread *lthread) |
virtual int64_t | load_buffer_and_write (int64_t towrite, int64_t &wattempted, int64_t &total_wrote, MIOBufferAccessor &buf, int &needs) |
void | readDisable (NetHandler *nh) |
void | readSignalError (NetHandler *nh, int err) |
int | readSignalDone (int event, NetHandler *nh) |
int | readSignalAndUpdate (int event) |
void | readReschedule (NetHandler *nh) |
void | writeReschedule (NetHandler *nh) |
void | netActivity (EThread *lthread) |
LINK (UnixNetVConnection, cop_link) | |
int | startEvent (int event, Event *e) |
int | acceptEvent (int event, Event *e) |
int | mainEvent (int event, Event *e) |
virtual int | connectUp (EThread *t, int fd) |
virtual void | free (EThread *t) |
virtual ink_hrtime | get_inactivity_timeout () |
virtual ink_hrtime | get_active_timeout () |
virtual void | set_local_addr () |
Set local sock addr struct. | |
virtual void | set_remote_addr () |
Set remote sock addr struct. | |
virtual int | set_tcp_init_cwnd (int init_cwnd) |
Set the TCP initial congestion window. | |
virtual void | apply_options () |
Attempt to push any changed options down. | |
Data Fields | |
Action | action_ |
volatile int | closed |
NetState | read |
NetState | write |
ink_hrtime | inactivity_timeout_in |
ink_hrtime | active_timeout_in |
ink_hrtime | next_inactivity_timeout_at |
Event * | active_timeout |
EventIO | ep |
NetHandler * | nh |
unsigned int | id |
IpEndpoint | server_addr |
union { | |
unsigned int flags | |
struct { | |
unsigned int got_local_addr:1 | |
unsigned int shutdown:2 | |
} f | |
}; | |
Server address and port. | |
Connection | con |
int | recursion |
ink_hrtime | submit_time |
OOB_callback * | oob_ptr |
bool | from_accept_thread |
Definition at line 102 of file P_UnixNetVConnection.h.
TS_INLINE UnixNetVConnection::~UnixNetVConnection | ( | ) | [virtual] |
Definition at line 383 of file P_UnixNetVConnection.h.
UnixNetVConnection::UnixNetVConnection | ( | ) |
Definition at line 793 of file UnixNetVConnection.cc.
References NetVConnection::local_addr, server_addr, SET_HANDLER, and startEvent().
int UnixNetVConnection::acceptEvent | ( | int | event, | |
Event * | e | |||
) |
Definition at line 953 of file UnixNetVConnection.cc.
References action_, active_timeout_in, Action::cancelled, close_UnixNetVConnection(), Action::continuation, Debug, ep, Event::ethread, EVENT_NONE, free(), get_NetHandler(), get_PollDescriptor(), Continuation::handleEvent(), inactivity_timeout_in, mainEvent(), Continuation::mutex, MUTEX_TRY_LOCK, NET_EVENT_ACCEPT, NET_RETRY_DELAY, nh, Event::schedule_in(), EThread::schedule_in(), set_active_timeout(), SET_HANDLER, set_inactivity_timeout(), EventIO::start(), and NetVConnection::thread.
Referenced by NetAccept::do_blocking_accept(), and net_accept().
void UnixNetVConnection::apply_options | ( | ) | [virtual] |
Attempt to push any changed options down.
Implements NetVConnection.
Definition at line 1204 of file UnixNetVConnection.cc.
References Connection::apply_options(), con, and NetVConnection::options.
TS_INLINE void UnixNetVConnection::cancel_active_timeout | ( | ) | [virtual] |
Clears the active timeout.
No active timeouts will be sent until set_active_timeout() is used to reset the active timeout.
Implements NetVConnection.
Definition at line 358 of file P_UnixNetVConnection.h.
References active_timeout, active_timeout_in, Action::cancel_action(), and Debug.
TS_INLINE void UnixNetVConnection::cancel_inactivity_timeout | ( | ) | [virtual] |
Clears the inactivity timeout.
No inactivity timeouts will be sent until set_inactivity_timeout() is used to reset the inactivity timeout.
Implements NetVConnection.
Definition at line 342 of file P_UnixNetVConnection.h.
References Debug, inactivity_timeout_in, and next_inactivity_timeout_at.
Referenced by CheckConnect::handle_connect().
void UnixNetVConnection::cancel_OOB | ( | ) | [virtual] |
Cancels a scheduled send_OOB.
Part of the message could have been sent already. Not callbacks to the cont are made after this call. The Action returned by send_OOB should not be accessed after cancel_OOB.
Reimplemented from NetVConnection.
Definition at line 652 of file UnixNetVConnection.cc.
References Action::cancel_action(), oob_ptr, and OOB_callback::trigger.
Referenced by close_UnixNetVConnection().
int UnixNetVConnection::connectUp | ( | EThread * | t, | |
int | fd | |||
) | [virtual] |
Definition at line 1080 of file UnixNetVConnection.cc.
References action_, active_timeout_in, NetVCOptions::addr_binding, check_emergency_throttle(), check_net_throttle(), check_throttle_warning(), con, Connection::connect(), CONNECT, Action::continuation, Debug, ENET_THROTTLING, ep, Connection::fd, free(), get_NetHandler(), get_PollDescriptor(), Continuation::handleEvent(), inactivity_timeout_in, ink_assert, NetVCOptions::ip_family, Connection::is_bound, Connection::is_connected, is_debug_tag_set, IpAddr::isValid(), VConnection::lerrno, NetVCOptions::local_ip, NetVCOptions::local_port, mainEvent(), NET_EVENT_OPEN, NET_EVENT_OPEN_FAILED, nh, NO_FD, Connection::open(), NetVConnection::options, IpEndpoint::sa, safe_getsockopt(), safe_nonblocking(), server_addr, SET_HANDLER, Connection::sock_type, EventIO::start(), submit_time, NetVConnection::thread, NetVCOptions::toString(), and IpAddr::toString().
Referenced by UnixNetProcessor::connect_re_internal(), startEvent(), and TSVConnFdCreate().
void UnixNetVConnection::do_io_close | ( | int | lerrno = -1 |
) | [virtual] |
Closes the vconnection.
A state machine MUST call do_io_close() when it has finished with a VConenction. do_io_close() indicates that the VConnection can be deallocated. After a close has been called, the VConnection and underlying processor must NOT send any more events related to this VConnection to the state machine. Likeswise, state machine must not access the VConnectuion or any returned VIOs after calling close. lerrno indicates whether a close is a normal close or an abort. The difference between a normal close and an abort depends on the underlying type of the VConnection. Passing VIO::CLOSE for lerrno indicates a normal close while passing VIO::ABORT indicates an abort.
lerrno | VIO:CLOSE for regular close or VIO::ABORT for aborts |
Implements NetVConnection.
Definition at line 581 of file UnixNetVConnection.cc.
References VIO::buffer, MIOBufferAccessor::clear(), close_UnixNetVConnection(), closed, disable_read, disable_write, VConnection::lerrno, Continuation::mutex, VIO::nbytes, nh, VIO::op, read, recursion, this_ethread(), NetState::vio, and write.
Referenced by SocksEntry::free(), CheckConnect::handle_connect(), and SocksEntry::startEvent().
VIO * UnixNetVConnection::do_io_read | ( | Continuation * | c, | |
int64_t | nbytes, | |||
MIOBuffer * | buf | |||
) | [virtual] |
Initiates read.
Thread safe, may be called when not handling an event from the NetVConnection, or the NetVConnection creation callback.
Callbacks: non-reentrant, c's lock taken during callbacks.
c->handleEvent(VC_EVENT_READ_READY, vio) | data added to buffer |
c->handleEvent(VC_EVENT_READ_COMPLETE, vio) | finished reading nbytes of data |
c->handleEvent(VC_EVENT_EOS, vio) | the stream has been shutdown |
c->handleEvent(VC_EVENT_ERROR, vio) | error |
The vio returned during callbacks is the same as the one returned by do_io_read(). The vio can be changed only during call backs from the vconnection.
c | continuation to be called back after (partial) read | |
nbytes | no of bytes to read, if unknown set to INT64_MAX | |
buf | buffer to put the data into |
Implements NetVConnection.
Definition at line 539 of file UnixNetVConnection.cc.
References VIO::_cont, VIO::buffer, MIOBufferAccessor::clear(), closed, disable_read, NetState::enabled, ink_assert, Continuation::mutex, VIO::mutex, VIO::nbytes, VIO::ndone, VIO::op, read, VIO::reenable(), VIO::vc_server, NetState::vio, and MIOBufferAccessor::writer_for().
Referenced by SocksEntry::free(), and SocksEntry::mainEvent().
void UnixNetVConnection::do_io_shutdown | ( | ShutdownHowTo_t | howto | ) | [virtual] |
Shuts down read side, write side, or both.
do_io_shutdown() can be used to terminate one or both sides of the VConnection. The howto is one of IO_SHUTDOWN_READ, IO_SHUTDOWN_WRITE, IO_SHUTDOWN_READWRITE. Once a side of a VConnection is shutdown, no further I/O can be done on that side of the connections and the underlying processor MUST NOT send any further events (INCLUDING TIMOUT EVENTS) to the state machine. The state machine MUST NOT use any VIOs from a shutdown side of a connection. Even if both sides of a connection are shutdown, the state machine MUST still call do_io_close() when it wishes the VConnection to be deallocated.
howto | IO_SHUTDOWN_READ, IO_SHUTDOWN_WRITE, IO_SHUTDOWN_READWRITE |
Implements NetVConnection.
Definition at line 608 of file UnixNetVConnection.cc.
References VIO::buffer, MIOBufferAccessor::clear(), con, disable_read, disable_write, f, Connection::fd, ink_assert, IO_SHUTDOWN_READ, IO_SHUTDOWN_READWRITE, IO_SHUTDOWN_WRITE, VIO::nbytes, NET_VC_SHUTDOWN_READ, read, SocketManager::shutdown(), socketManager, NetState::vio, and write.
VIO * UnixNetVConnection::do_io_write | ( | Continuation * | c, | |
int64_t | nbytes, | |||
IOBufferReader * | buf, | |||
bool | owner = false | |||
) | [virtual] |
Initiates write.
Thread-safe, may be called when not handling an event from the NetVConnection, or the NetVConnection creation callback.
Callbacks: non-reentrant, c's lock taken during callbacks.
c->handleEvent(VC_EVENT_WRITE_READY, vio) | signifies data has written from the reader or there are no bytes available for the reader to write. |
c->handleEvent(VC_EVENT_WRITE_COMPLETE, vio) | signifies the amount of data indicated by nbytes has been read from the buffer |
c->handleEvent(VC_EVENT_ERROR, vio) | signified that error occured during write. |
The vio returned during callbacks is the same as the one returned by do_io_write(). The vio can be changed only during call backs from the vconnection. The vconnection deallocates the reader when it is destroyed.
c | continuation to be called back after (partial) write | |
nbytes | no of bytes to write, if unknown msut be set to INT64_MAX | |
buf | source of data | |
owner |
Implements NetVConnection.
Definition at line 560 of file UnixNetVConnection.cc.
References VIO::_cont, VIO::buffer, closed, disable_write, NetState::enabled, ink_assert, Continuation::mutex, VIO::mutex, VIO::nbytes, VIO::ndone, VIO::op, MIOBufferAccessor::reader_for(), VIO::reenable(), VIO::vc_server, NetState::vio, and write.
Referenced by SocksEntry::free(), CheckConnect::handle_connect(), and SocksEntry::mainEvent().
void UnixNetVConnection::free | ( | EThread * | t | ) | [virtual] |
Reimplemented in SSLNetVConnection.
Definition at line 1170 of file UnixNetVConnection.cc.
References action_, active_timeout, Ptr< T >::clear(), closed, con, NetState::enable_link, Connection::fd, flags, from_accept_thread, got_local_addr, NetVConnection::got_remote_addr, ink_assert, VIO::mutex, Action::mutex, Continuation::mutex, net_connections_currently_open_stat, NET_SUM_GLOBAL_DYN_STAT, netVCAllocator, SLink< C >::next, nh, NO_FD, NetVConnection::options, Link< C >::prev, read, NetState::ready_link, NetVCOptions::reset(), SET_CONTINUATION_HANDLER, startEvent(), this_ethread(), THREAD_FREE, NetState::triggered, NetState::vio, and write.
Referenced by acceptEvent(), NetAccept::acceptFastEvent(), close_UnixNetVConnection(), connectUp(), startEvent(), and TSVConnFdCreate().
TS_INLINE ink_hrtime UnixNetVConnection::get_active_timeout | ( | ) | [virtual] |
Implements NetVConnection.
Definition at line 274 of file P_UnixNetVConnection.h.
References active_timeout_in.
bool UnixNetVConnection::get_data | ( | int | id, | |
void * | data | |||
) | [virtual] |
Convenience function to retrieve information from VConnection.
This function is provided as a convenience for state machines to transmit information from/to a VConnection without breaking the VConnection abstraction. Its behavior varies depending on the type of VConnection being used.
id | Identifier associated to interpret the data field | |
data | Value or pointer with state machine or VConnection data. |
Reimplemented from VConnection.
Definition at line 517 of file UnixNetVConnection.cc.
References read, TS_API_DATA_READ_VIO, TS_API_DATA_WRITE_VIO, NetState::vio, and write.
TS_INLINE ink_hrtime UnixNetVConnection::get_inactivity_timeout | ( | ) | [virtual] |
Implements NetVConnection.
Definition at line 280 of file P_UnixNetVConnection.h.
References inactivity_timeout_in.
void UnixNetVConnection::get_local_sa | ( | ) |
TS_INLINE SOCKET UnixNetVConnection::get_socket | ( | ) | [virtual] |
Implements NetVConnection.
Definition at line 386 of file P_UnixNetVConnection.h.
References con, and Connection::fd.
Referenced by make_ssl_connection().
virtual bool UnixNetVConnection::getSSLClientConnection | ( | ) | [inline, virtual] |
Reimplemented in SSLNetVConnection.
Definition at line 179 of file P_UnixNetVConnection.h.
Referenced by write_to_net_io().
virtual bool UnixNetVConnection::getSSLHandShakeComplete | ( | ) | [inline, virtual] |
Reimplemented in SSLNetVConnection.
Definition at line 176 of file P_UnixNetVConnection.h.
Referenced by write_to_net_io().
virtual bool UnixNetVConnection::getSSLHandshakeWantsRead | ( | ) | [inline, virtual] |
Definition at line 115 of file P_UnixNetVConnection.h.
virtual bool UnixNetVConnection::getSSLHandshakeWantsWrite | ( | ) | [inline, virtual] |
Definition at line 118 of file P_UnixNetVConnection.h.
UnixNetVConnection::LINK | ( | UnixNetVConnection | , | |
cop_link | ||||
) |
int64_t UnixNetVConnection::load_buffer_and_write | ( | int64_t | towrite, | |
int64_t & | wattempted, | |||
int64_t & | total_wrote, | |||
MIOBufferAccessor & | buf, | |||
int & | needs | |||
) | [virtual] |
Reimplemented in SSLNetVConnection.
Definition at line 841 of file UnixNetVConnection.cc.
References IOBufferReader::block, con, Connection::fd, Thread::mutex, Continuation::mutex, net_calls_to_write_stat, NET_DEBUG_COUNT_DYN_STAT, NET_MAX_IOV, IOBufferBlock::next, IOBufferBlock::read_avail(), MIOBufferAccessor::reader(), socketManager, IOBufferBlock::start(), IOBufferReader::start_offset, NetVConnection::thread, SocketManager::write(), and SocketManager::writev().
Referenced by write_to_net_io().
int UnixNetVConnection::mainEvent | ( | int | event, | |
Event * | e | |||
) |
Definition at line 1003 of file UnixNetVConnection.cc.
References VIO::_cont, active_timeout, Action::cancelled, close_UnixNetVConnection(), closed, Event::ethread, EVENT_DONE, EVENT_IMMEDIATE, EVENT_INTERVAL, f, get_NetHandler(), inactivity_timeout_in, ink_assert, ink_get_hrtime(), Ptr< T >::m_ptr, Thread::mutex, VIO::mutex, Continuation::mutex, MUTEX_TRY_LOCK, NET_RETRY_DELAY, NET_VC_SHUTDOWN_READ, NET_VC_SHUTDOWN_WRITE, next_inactivity_timeout_at, VIO::op, VIO::READ, read, read_signal_and_update(), Event::schedule_in(), this_ethread(), NetVConnection::thread, NetState::vio, VIO::WRITE, write, and write_signal_and_update().
Referenced by acceptEvent(), NetAccept::acceptFastEvent(), and connectUp().
void UnixNetVConnection::net_read_io | ( | NetHandler * | nh, | |
EThread * | lthread | |||
) | [virtual] |
Reimplemented in SSLNetVConnection.
Definition at line 831 of file UnixNetVConnection.cc.
References read_from_net().
Referenced by NetHandler::mainNetEvent(), and reenable_re().
void UnixNetVConnection::netActivity | ( | EThread * | lthread | ) |
Definition at line 932 of file UnixNetVConnection.cc.
References net_activity().
Referenced by ssl_read_from_net().
void UnixNetVConnection::readDisable | ( | NetHandler * | nh | ) |
Definition at line 892 of file UnixNetVConnection.cc.
References read_disable().
void UnixNetVConnection::readReschedule | ( | NetHandler * | nh | ) |
Definition at line 920 of file UnixNetVConnection.cc.
References read_reschedule().
Referenced by NetHandler::mainNetEvent(), and SSLNetVConnection::net_read_io().
int UnixNetVConnection::readSignalAndUpdate | ( | int | event | ) |
Definition at line 911 of file UnixNetVConnection.cc.
References read_signal_and_update().
Referenced by SSLNetVConnection::net_read_io().
int UnixNetVConnection::readSignalDone | ( | int | event, | |
NetHandler * | nh | |||
) |
Definition at line 904 of file UnixNetVConnection.cc.
References read_signal_done().
Referenced by SSLNetVConnection::net_read_io().
void UnixNetVConnection::readSignalError | ( | NetHandler * | nh, | |
int | err | |||
) |
Definition at line 898 of file UnixNetVConnection.cc.
References read_signal_error().
Referenced by SSLNetVConnection::net_read_io().
void UnixNetVConnection::reenable | ( | VIO * | vio | ) | [virtual] |
PRIVATE: The public interface is VIO::reenable().
Implements NetVConnection.
Definition at line 702 of file UnixNetVConnection.cc.
References closed, ep, Event::ethread, NetState::in_enabled_list, ink_assert, EventIO::modify(), Continuation::mutex, VIO::mutex, MUTEX_TRY_LOCK, nh, read, EventIO::refresh(), set_enabled(), EThread::signal_hook, STATE_FROM_VIO, this_ethread(), NetVConnection::thread, NetHandler::trigger_event, NetState::triggered, NetState::vio, and write.
Referenced by reenable_re().
void UnixNetVConnection::reenable_re | ( | VIO * | vio | ) | [virtual] |
PRIVATE: The public interface is VIO::reenable().
Implements NetVConnection.
Definition at line 765 of file UnixNetVConnection.cc.
References ep, ink_assert, EventIO::modify(), Continuation::mutex, VIO::mutex, net_read_io(), nh, read, reenable(), EventIO::refresh(), set_enabled(), this_ethread(), NetVConnection::thread, NetState::triggered, NetState::vio, write, and write_to_net().
Action * UnixNetVConnection::send_OOB | ( | Continuation * | cont, | |
char * | buf, | |||
int | len | |||
) | [virtual] |
Sends out of band messages over the connection.
This function is used to send out of band messages (is this still useful?). cont is called back with VC_EVENT_OOB_COMPLETE - on successful send or VC_EVENT_EOS - if the other side has shutdown the connection. These callbacks could be re-entrant. Only one send_OOB can be in progress at any time for a VC.
cont | to be called back with events. | |
buf | message buffer. | |
len | length of the message. |
Reimplemented from NetVConnection.
Definition at line 666 of file UnixNetVConnection.cc.
References con, Connection::fd, Continuation::handleEvent(), HRTIME_MSECONDS, ink_assert, Continuation::mutex, oob_ptr, SocketManager::send(), socketManager, this_ethread(), OOB_callback::trigger, VC_EVENT_EOS, and VC_EVENT_OOB_COMPLETE.
Referenced by OOB_callback::retry_OOB_send().
TS_INLINE void UnixNetVConnection::set_active_timeout | ( | ink_hrtime | timeout_in | ) | [virtual] |
Sets time after which SM should be notified.
Sets the amount of time (in nanoseconds) after which the state machine using the NetVConnection should receive a VC_EVENT_ACTIVE_TIMEOUT event. The timeout is value is ignored if neither the read side nor the write side of the connection is currently active. The timer is reset if the function is called repeatedly This call can be used by SMs to make sure that it does not keep any connections open for a really long time.
Timeout symantics:
Should a timeout occur, the state machine for the read side of the NetVConnection is signaled first assuming that a read has been initiated on the NetVConnection and that the read side of the NetVConnection has not been shutdown. Should either of the two conditions not be met, the NetProcessor will attempt to signal the write side. If a timeout is sent to the read side state machine and its handler, return EVENT_DONE, a timeout will not be sent to the write side. Should the return from the handler not be EVENT_DONE and the write side state machine is different (in terms of pointer comparison) from the read side state machine, the NetProcessor will try to signal the write side state machine as well. To signal write side, a write must have been initiated on it and the write must not have been shutdown.
Receiving a timeout is only a notification that the timer has expired. The NetVConnection is still usable. Further timeouts of the type signaled will not be generated unless the timeout is reset via the set_active_timeout() or set_inactivity_timeout() interfaces.
Implements NetVConnection.
Definition at line 316 of file P_UnixNetVConnection.h.
References active_timeout, active_timeout_in, Action::cancel_action(), Debug, NetState::enabled, ink_assert, VIO::mutex, read, EThread::schedule_in(), EThread::schedule_in_local(), this_ethread(), NetVConnection::thread, NetState::vio, and write.
Referenced by acceptEvent().
void UnixNetVConnection::set_enabled | ( | VIO * | vio | ) |
Definition at line 812 of file UnixNetVConnection.cc.
References closed, inactivity_timeout_in, ink_assert, ink_get_hrtime(), VIO::mutex, next_inactivity_timeout_at, EThread::schedule_in(), EThread::schedule_in_local(), STATE_FROM_VIO, this_ethread(), and NetVConnection::thread.
Referenced by reenable(), and reenable_re().
TS_INLINE void UnixNetVConnection::set_inactivity_timeout | ( | ink_hrtime | timeout_in | ) | [virtual] |
Sets time after which SM should be notified if the requested IO could not be performed.
Sets the amount of time (in nanoseconds), if the NetVConnection is idle on both the read or write side, after which the state machine using the NetVConnection should receive a VC_EVENT_INACTIVITY_TIMEOUT event. Either read or write traffic will cause timer to be reset. Calling this function again also resets the timer. The timeout is value is ignored if neither the read side nor the write side of the connection is currently active. See section on timeout semantics above.
Implements NetVConnection.
Definition at line 286 of file P_UnixNetVConnection.h.
References Debug, NetState::enabled, inactivity_timeout_in, ink_assert, ink_get_hrtime(), VIO::mutex, next_inactivity_timeout_at, read, EThread::schedule_in(), EThread::schedule_in_local(), this_ethread(), NetVConnection::thread, NetState::vio, and write.
Referenced by acceptEvent(), and CheckConnect::handle_connect().
TS_INLINE void UnixNetVConnection::set_local_addr | ( | ) | [virtual] |
Set local sock addr struct.
Implements NetVConnection.
Definition at line 267 of file P_UnixNetVConnection.h.
References con, Connection::fd, NetVConnection::local_addr, IpEndpoint::sa, and safe_getsockname().
TS_INLINE void UnixNetVConnection::set_remote_addr | ( | ) | [virtual] |
Set remote sock addr struct.
Implements NetVConnection.
Definition at line 261 of file P_UnixNetVConnection.h.
References Connection::addr, ats_ip_copy(), con, and NetVConnection::remote_addr.
TS_INLINE int UnixNetVConnection::set_tcp_init_cwnd | ( | int | init_cwnd | ) | [virtual] |
Set the TCP initial congestion window.
Implements NetVConnection.
Definition at line 369 of file P_UnixNetVConnection.h.
References con, Debug, Connection::fd, and val.
virtual void UnixNetVConnection::setSSLClientConnection | ( | bool | state | ) | [inline, virtual] |
Reimplemented in SSLNetVConnection.
Definition at line 183 of file P_UnixNetVConnection.h.
Referenced by UnixNetProcessor::connect_re_internal().
virtual void UnixNetVConnection::setSSLHandshakeWantsRead | ( | bool | ) | [inline, virtual] |
Definition at line 114 of file P_UnixNetVConnection.h.
virtual void UnixNetVConnection::setSSLHandshakeWantsWrite | ( | bool | ) | [inline, virtual] |
Definition at line 116 of file P_UnixNetVConnection.h.
virtual int UnixNetVConnection::sslStartHandShake | ( | int | event, | |
int & | err | |||
) | [inline, virtual] |
Reimplemented in SSLNetVConnection.
Definition at line 171 of file P_UnixNetVConnection.h.
Referenced by write_to_net_io().
int UnixNetVConnection::startEvent | ( | int | event, | |
Event * | e | |||
) |
Definition at line 938 of file UnixNetVConnection.cc.
References action_, Action::cancelled, connectUp(), Event::ethread, free(), get_NetHandler(), Continuation::mutex, MUTEX_TRY_LOCK, NET_RETRY_DELAY, NO_FD, and Event::schedule_in().
Referenced by free(), SSLNetVConnection::free(), and UnixNetVConnection().
void UnixNetVConnection::writeReschedule | ( | NetHandler * | nh | ) |
Definition at line 926 of file UnixNetVConnection.cc.
References write_reschedule().
Referenced by NetHandler::mainNetEvent(), SSLNetVConnection::net_read_io(), and SSLNetVConnection::sslClientHandShakeEvent().
union { ... } |
Server address and port.
Definition at line 197 of file P_UnixNetVConnection.h.
Referenced by acceptEvent(), UnixNetProcessor::connect_re_internal(), connectUp(), NetAccept::do_blocking_accept(), free(), SocksEntry::free(), net_accept(), startEvent(), and TSVConnFdCreate().
Definition at line 215 of file P_UnixNetVConnection.h.
Referenced by cancel_active_timeout(), close_UnixNetVConnection(), free(), mainEvent(), and set_active_timeout().
Definition at line 209 of file P_UnixNetVConnection.h.
Referenced by acceptEvent(), cancel_active_timeout(), close_UnixNetVConnection(), connectUp(), get_active_timeout(), and set_active_timeout().
volatile int UnixNetVConnection::closed |
Definition at line 198 of file P_UnixNetVConnection.h.
Referenced by do_io_close(), do_io_read(), do_io_write(), free(), SSLNetVConnection::free(), mainEvent(), NetHandler::mainNetEvent(), net_accept(), NetHandler::process_enabled_list(), CoreUtils::process_NetVC(), read_signal_and_update(), reenable(), set_enabled(), SSLNetVConnection::sslClientHandShakeEvent(), and write_signal_and_update().
Definition at line 234 of file P_UnixNetVConnection.h.
Referenced by NetAccept::acceptFastEvent(), apply_options(), close_UnixNetVConnection(), connectUp(), NetAccept::do_blocking_accept(), do_io_shutdown(), free(), SSLNetVConnection::free(), get_socket(), CheckConnect::handle_connect(), load_buffer_and_write(), net_accept(), read_from_net(), send_OOB(), set_local_addr(), set_remote_addr(), set_tcp_init_cwnd(), and EventIO::start().
Definition at line 216 of file P_UnixNetVConnection.h.
Referenced by acceptEvent(), NetAccept::acceptFastEvent(), close_UnixNetVConnection(), connectUp(), NetHandler::mainNetEvent(), NetHandler::process_enabled_list(), read_disable(), read_reschedule(), reenable(), reenable_re(), ClusterHandler::startClusterEvent(), write_disable(), and write_reschedule().
struct { ... } UnixNetVConnection::f |
Referenced by do_io_shutdown(), and mainEvent().
unsigned int UnixNetVConnection::flags |
Definition at line 224 of file P_UnixNetVConnection.h.
Referenced by free(), and SSLNetVConnection::free().
Definition at line 238 of file P_UnixNetVConnection.h.
Referenced by UnixNetProcessor::allocate_vc(), SSLNetProcessor::allocate_vc(), NetAccept::do_blocking_accept(), free(), and SSLNetVConnection::free().
unsigned int UnixNetVConnection::got_local_addr |
Reimplemented from NetVConnection.
Definition at line 229 of file P_UnixNetVConnection.h.
Referenced by free(), and SSLNetVConnection::free().
unsigned int UnixNetVConnection::id |
Definition at line 218 of file P_UnixNetVConnection.h.
Referenced by NetAccept::acceptFastEvent(), UnixNetProcessor::connect_re_internal(), NetAccept::do_blocking_accept(), net_accept(), and TSVConnFdCreate().
Definition at line 208 of file P_UnixNetVConnection.h.
Referenced by acceptEvent(), cancel_inactivity_timeout(), close_UnixNetVConnection(), connectUp(), get_inactivity_timeout(), mainEvent(), net_activity(), set_enabled(), and set_inactivity_timeout().
Definition at line 213 of file P_UnixNetVConnection.h.
Referenced by cancel_inactivity_timeout(), close_UnixNetVConnection(), mainEvent(), net_activity(), read_disable(), set_enabled(), set_inactivity_timeout(), and write_disable().
Definition at line 217 of file P_UnixNetVConnection.h.
Referenced by acceptEvent(), NetAccept::acceptFastEvent(), close_UnixNetVConnection(), connectUp(), do_io_close(), free(), SSLNetVConnection::free(), reenable(), reenable_re(), SSLNetVConnection::sslClientHandShakeEvent(), and ClusterHandler::startClusterEvent().
Definition at line 237 of file P_UnixNetVConnection.h.
Referenced by cancel_OOB(), OOB_callback::retry_OOB_send(), and send_OOB().
Definition at line 199 of file P_UnixNetVConnection.h.
Referenced by NetAccept::acceptFastEvent(), close_UnixNetVConnection(), do_io_close(), do_io_read(), do_io_shutdown(), SSLNetVConnection::enableRead(), free(), SSLNetVConnection::free(), get_data(), mainEvent(), NetHandler::mainNetEvent(), SSLNetVConnection::net_read_io(), NetHandler::process_enabled_list(), CoreUtils::process_NetVC(), read_disable(), read_from_net(), read_reschedule(), read_signal_and_update(), read_signal_done(), reenable(), reenable_re(), set_active_timeout(), set_inactivity_timeout(), ssl_read_from_net(), ClusterHandler::startClusterEvent(), write_disable(), and write_to_net_io().
Definition at line 235 of file P_UnixNetVConnection.h.
Referenced by do_io_close(), read_signal_and_update(), and write_signal_and_update().
Definition at line 220 of file P_UnixNetVConnection.h.
Referenced by NetAccept::acceptFastEvent(), UnixNetProcessor::connect_re_internal(), connectUp(), NetAccept::do_blocking_accept(), SocksEntry::free(), net_accept(), CoreUtils::process_NetVC(), and UnixNetVConnection().
unsigned int UnixNetVConnection::shutdown |
Definition at line 230 of file P_UnixNetVConnection.h.
Definition at line 236 of file P_UnixNetVConnection.h.
Referenced by NetAccept::acceptFastEvent(), UnixNetProcessor::connect_re_internal(), connectUp(), NetAccept::do_blocking_accept(), net_accept(), and TSVConnFdCreate().
Definition at line 200 of file P_UnixNetVConnection.h.
Referenced by close_UnixNetVConnection(), do_io_close(), do_io_shutdown(), do_io_write(), SSLNetVConnection::enableRead(), free(), SSLNetVConnection::free(), get_data(), CheckConnect::handle_connect(), mainEvent(), NetHandler::mainNetEvent(), SSLNetVConnection::net_read_io(), NetHandler::process_enabled_list(), CoreUtils::process_NetVC(), read_disable(), reenable(), reenable_re(), set_active_timeout(), set_inactivity_timeout(), SSLNetVConnection::sslClientHandShakeEvent(), ClusterHandler::startClusterEvent(), write_disable(), write_reschedule(), write_signal_and_update(), write_signal_done(), and write_to_net_io().