Public Member Functions | Data Fields

ClusterVConnectionBase Struct Reference

#include <P_ClusterCache.h>

Inherits CacheVConnection.

Inherited by ClusterVConnection.

Collaboration diagram for ClusterVConnectionBase:
Collaboration graph
[legend]

Public Member Functions

virtual VIOdo_io_read (Continuation *c, int64_t nbytes, MIOBuffer *buf)
 Read data from the VConnection.
virtual VIOdo_io_write (Continuation *c, int64_t nbytes, IOBufferReader *buf, bool owner=false)
 Write data to the VConnection.
virtual void do_io_shutdown (ShutdownHowTo_t howto)
 Terminate one or both directions of the VConnection.
virtual void do_io_close (int lerrno=-1)
 Indicate that the VConnection is no longer needed.
virtual VIOdo_io_pread (Continuation *, int64_t, MIOBuffer *, int64_t)
void set_active_timeout (ink_hrtime timeout_in)
void set_inactivity_timeout (ink_hrtime timeout_in)
void cancel_active_timeout ()
void cancel_inactivity_timeout ()
 ClusterVConnectionBase ()
virtual void reenable (VIO *)
virtual void reenable_re (VIO *)

Data Fields

Action action_
EThreadthread
volatile int closed
ClusterVConnState read
ClusterVConnState write
ink_hrtime inactivity_timeout_in
ink_hrtime active_timeout_in
Eventinactivity_timeout
Eventactive_timeout

Detailed Description

Definition at line 334 of file P_ClusterCache.h.


Constructor & Destructor Documentation

ClusterVConnectionBase::ClusterVConnectionBase (  ) 

Definition at line 66 of file ClusterVConnection.cc.


Member Function Documentation

void ClusterVConnectionBase::cancel_active_timeout (  )  [inline]

Definition at line 430 of file P_ClusterCache.h.

References active_timeout, active_timeout_in, and Action::cancel().

void ClusterVConnectionBase::cancel_inactivity_timeout (  )  [inline]

Definition at line 440 of file P_ClusterCache.h.

References Action::cancel(), inactivity_timeout, and inactivity_timeout_in.

void ClusterVConnectionBase::do_io_close ( int  lerrno = -1  )  [virtual]

Indicate that the VConnection is no longer needed.

Once the state machine has finished using this VConnection, it must call this function to indicate 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, the state machine must not access the VConnection or any VIOs obtained from it after calling this method.

Parameters:
lerrno indicates where 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.

Implements CacheVConnection.

Reimplemented in ClusterVConnection.

Definition at line 138 of file ClusterVConnection.cc.

References VIO::buffer, MIOBufferAccessor::clear(), closed, ClusterVConnState::enabled, VConnection::lerrno, read, ClusterVConnState::vio, and write.

VIO * ClusterVConnectionBase::do_io_pread ( Continuation ,
int64_t  ,
MIOBuffer ,
int64_t   
) [virtual]

Implements CacheVConnection.

Definition at line 94 of file ClusterVConnection.cc.

VIO * ClusterVConnectionBase::do_io_read ( Continuation c,
int64_t  nbytes,
MIOBuffer buf 
) [virtual]

Read data from the VConnection.

Called by a state machine to read data from the VConnection. Processors implementing read functionality take out lock, put new bytes on the buffer and call the continuation back before releasing the lock in order to enable the state machine to handle transfer schemes where the end of a given transaction is marked by a special character (ie: NNTP).

Possible Event Codes

On the callback to the continuation, the VConnection may use on of the following values for the event code:

Event code Meaning
VC_EVENT_READ_READY Data has been added to the buffer or the buffer is full
VC_EVENT_READ_COMPLETE The amount of data indicated by 'nbytes' has been read into the buffer
VC_EVENT_EOS The stream being read from has been shutdown
VC_EVENT_ERROR An error occurred during the read
Parameters:
c Continuation to be called back with events.
nbytes Number of bytes to read. If unknown, nbytes must be set to INT64_MAX.
buf buffer to read into.
Returns:
VIO representing the scheduled IO operation.

Implements CacheVConnection.

Reimplemented in ClusterVConnection.

Definition at line 77 of file ClusterVConnection.cc.

References VIO::buffer, ClusterVConnection::channel, closed, Debug, ClusterVConnState::enabled, ink_assert, VIO::nbytes, VIO::ndone, VIO::op, read, VIO::set_continuation(), VIO::vc_server, ClusterVConnState::vio, and MIOBufferAccessor::writer_for().

virtual void ClusterVConnectionBase::do_io_shutdown ( ShutdownHowTo_t  howto  )  [inline, virtual]

Terminate one or both directions of the VConnection.

Indicates that one or both sides of the VConnection should be terminated. After this call is issued, no further I/O can be done on the specified direction of the connection. The processor must not send any further events (including timeout events) to the state machine, and the state machine must not use any VIOs from a shutdown direction of the 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.

Possible howto values

Value Meaning
IO_SHUTDOWN_READ Indicates that this VConnection should not generate any more read events
IO_SHUTDOWN_WRITE Indicates that this VConnection should not generate any more write events
IO_SHUTDOWN_READWRITE Indicates that this VConnection should not generate any more read nor write events
Parameters:
howto Specifies which direction of the VConnection to shutdown.

Reimplemented from CacheVConnection.

Definition at line 347 of file P_ClusterCache.h.

References ink_assert.

VIO * ClusterVConnectionBase::do_io_write ( Continuation c,
int64_t  nbytes,
IOBufferReader buf,
bool  owner = false 
) [virtual]

Write data to the VConnection.

This method is called by a state machine to write data to the VConnection.

Possible Event Codes

On the callback to the continuation, the VConnection may use on of the following event codes:

Event code Meaning
VC_EVENT_WRITE_READY Data was written from the reader or there are no bytes available for the reader to write.
VC_EVENT_WRITE_COMPLETE The amount of data indicated by 'nbytes' has been written to the VConnection
VC_EVENT_INACTIVITY_TIMEOUT No activity was performed for a certain period.
VC_EVENT_ACTIVE_TIMEOUT Write operation continued beyond a time limit.
VC_EVENT_ERROR An error occurred during the write
Parameters:
c Continuation to be called back with events.
nbytes Number of bytes to write. If unknown, nbytes must be set to INT64_MAX.
buf Reader whose data is to be read from.
owner 
Returns:
VIO representing the scheduled IO operation.

Implements CacheVConnection.

Reimplemented in ClusterVConnection.

Definition at line 122 of file ClusterVConnection.cc.

References VIO::buffer, closed, ClusterVConnState::enabled, ink_assert, VIO::nbytes, VIO::ndone, VIO::op, MIOBufferAccessor::reader_for(), VIO::set_continuation(), VIO::vc_server, ClusterVConnState::vio, and write.

void ClusterVConnectionBase::reenable ( VIO vio  )  [virtual]
void ClusterVConnectionBase::reenable_re ( VIO vio  )  [virtual]

Implements CacheVConnection.

Definition at line 186 of file ClusterVConnection.cc.

References reenable().

void ClusterVConnectionBase::set_active_timeout ( ink_hrtime  timeout_in  )  [inline]
void ClusterVConnectionBase::set_inactivity_timeout ( ink_hrtime  timeout_in  )  [inline]

Field Documentation

Definition at line 383 of file P_ClusterCache.h.

Referenced by cancel_active_timeout().

Definition at line 382 of file P_ClusterCache.h.

Referenced by cancel_inactivity_timeout(), and set_inactivity_timeout().

Definition at line 376 of file P_ClusterCache.h.

Referenced by set_active_timeout(), and set_inactivity_timeout().


The documentation for this struct was generated from the following files: