Public Member Functions

UDPConnection Class Reference

UDP Connection endpoint. More...

#include <I_UDPConnection.h>

Inherits Continuation.

Inherited by UDPConnectionInternal.

Collaboration diagram for UDPConnection:
Collaboration graph
[legend]

Public Member Functions

virtual ~UDPConnection ()
SOCKET getFd ()
void setBinding (struct sockaddr const *)
inkcoreapi int getBinding (struct sockaddr *)
void destroy ()
int shouldDestroy ()
Actionsend (Continuation *c, UDPPacket *p)
Actionrecv (Continuation *c)
void Release ()
void AddRef ()
int GetRefCount ()
int getPortNum (void)
int GetSendGenerationNumber ()
void SetLastSentPktTSSeqNum (int64_t sentSeqNum)
int64_t cancel ()
void setContinuation (Continuation *c)
void bindToThread (Continuation *c)
 Put socket on net queue for read/write polling.
virtual void UDPConnection_is_abstract ()=0

Detailed Description

UDP Connection endpoint.

You can schedule packet to be sent immediately or for the future, and set up a persistent receive() operation.

Definition at line 45 of file I_UDPConnection.h.


Constructor & Destructor Documentation

virtual UDPConnection::~UDPConnection (  )  [inline, virtual]

Definition at line 48 of file I_UDPConnection.h.


Member Function Documentation

TS_INLINE void UDPConnection::AddRef (  ) 
void UDPConnection::bindToThread ( Continuation c  ) 

Put socket on net queue for read/write polling.

Not required for UDPConnections created with UDPNetProcessor::UDPBind

Required for and UDPNetProcessor::CreateUDPSocket. They don't do bindToThread() automatically so that the sockets can be passed to other Continuations.

Definition at line 104 of file UnixUDPConnection.cc.

References AddRef(), EventProcessor::assign_thread(), UDPConnectionInternal::continuation, ET_UDP, UnixUDPConnection::ethread, eventProcessor, get_UDPNetHandler(), ink_assert, ink_atomiclist_push(), and Continuation::mutex.

Referenced by UDPNetProcessor::UDPBind().

TS_INLINE int64_t UDPConnection::cancel ( void   ) 
TS_INLINE void UDPConnection::destroy (  ) 

Definition at line 107 of file P_UDPConnection.h.

Referenced by UnixUDPConnection::callbackHandler().

TS_INLINE int UDPConnection::getBinding ( struct sockaddr *  s  ) 
TS_INLINE SOCKET UDPConnection::getFd (  ) 
TS_INLINE int UDPConnection::getPortNum ( void   ) 

Definition at line 137 of file P_UDPConnection.h.

References ats_ip_port_host_order().

Referenced by UnixUDPConnection::~UnixUDPConnection().

TS_INLINE int UDPConnection::GetRefCount (  ) 

Definition at line 125 of file P_UDPConnection.h.

TS_INLINE int UDPConnection::GetSendGenerationNumber (  ) 

Definition at line 131 of file P_UDPConnection.h.

Referenced by PacketQueue::IsCancelledPacket(), and UDPQueue::SendPackets().

TS_INLINE Action * UDPConnection::recv ( Continuation c  ) 

Callbacks:
cont->handleEvent(NET_EVENT_DATAGRAM_ERROR, UDPConnection *) on error
cont->handleEvent(NET_EVENT_DATAGRAM_READ_READY, Queue<UDPPacketInternal> *) on incoming packets.

Returns:
Action* Always returns ACTION_RESULT_NONE. Can't be cancelled via this Action.
Parameters:
c continuation to be called back

Definition at line 102 of file P_UnixUDPConnection.h.

References UDPConnectionInternal::continuation, ink_assert, Continuation::mutex, and UDPConnectionInternal::recvActive.

Referenced by INKUDPRecvFrom().

void UDPConnection::Release (  ) 
Action * UDPConnection::send ( Continuation c,
UDPPacket p 
)

Callbacks:
cont->handleEvent(NET_EVENT_DATAGRAM_WRITE_ERROR, UDPPacket *) on error
no callback on success.

Returns:
Action* send can't be cancelled via this Action
Parameters:
c continuation to be called back
p packet to be sent.

Definition at line 119 of file UnixUDPConnection.cc.

References UDPConnectionInternal::continuation, UnixUDPConnection::ethread, UDPPacketInternal::free(), get_UDPNetHandler(), ink_assert, Continuation::mutex, UDPPacketInternal::reqGenerationNum, UDPQueue::send(), UDPConnectionInternal::sendGenerationNum, UDPPacket::setConnection(), UDPPacket::setContinuation(), shouldDestroy(), and UDPNetHandler::udpOutQueue.

Referenced by INKUDPSendTo().

TS_INLINE void UDPConnection::setBinding ( struct sockaddr const *  s  ) 
TS_INLINE void UDPConnection::setContinuation ( Continuation c  ) 

Definition at line 159 of file P_UDPConnection.h.

References ink_assert, and Continuation::mutex.

TS_INLINE void UDPConnection::SetLastSentPktTSSeqNum ( int64_t  sentSeqNum  ) 

Definition at line 153 of file P_UDPConnection.h.

TS_INLINE int UDPConnection::shouldDestroy (  ) 
virtual void UDPConnection::UDPConnection_is_abstract (  )  [pure virtual]

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