0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Types | Public Member Functions | Private Attributes | List of all members
Hyperspace::ClientConnectionHandler Class Reference

#include <ClientConnectionHandler.h>

Inheritance diagram for Hyperspace::ClientConnectionHandler:
Inheritance graph
[legend]
Collaboration diagram for Hyperspace::ClientConnectionHandler:
Collaboration graph
[legend]

Public Types

enum  { DISCONNECTED, CONNECTING, HANDSHAKING, CONNECTED }
 

Public Member Functions

 ClientConnectionHandler (Comm *comm, Session *session, uint32_t timeout_ms)
 
virtual ~ClientConnectionHandler ()
 
virtual void handle (Hypertable::EventPtr &event_ptr)
 Callback method. More...
 
void set_session_id (uint64_t id)
 
bool disconnected ()
 
int initiate_connection (struct sockaddr_in &addr)
 
void set_verbose_mode (bool verbose)
 
void disable_callbacks ()
 
void close ()
 
- Public Member Functions inherited from Hypertable::DispatchHandler
virtual ~DispatchHandler ()
 Destructor. More...
 

Private Attributes

std::recursive_mutex m_mutex
 
std::condition_variable_any m_cond
 
Commm_comm {}
 
Sessionm_session {}
 
uint64_t m_session_id {}
 
int m_state {}
 
struct sockaddr_in m_master_addr
 
uint32_t m_timeout_ms {}
 
bool m_verbose {}
 
bool m_callbacks_enabled {}
 

Detailed Description

Definition at line 42 of file ClientConnectionHandler.h.

Member Enumeration Documentation

anonymous enum
Enumerator
DISCONNECTED 
CONNECTING 
HANDSHAKING 
CONNECTED 

Definition at line 45 of file ClientConnectionHandler.h.

Constructor & Destructor Documentation

ClientConnectionHandler::ClientConnectionHandler ( Comm comm,
Session session,
uint32_t  timeout_ms 
)

Definition at line 36 of file ClientConnectionHandler.cc.

ClientConnectionHandler::~ClientConnectionHandler ( )
virtual

was causing deadlock ... if (m_master_addr.sin_port != 0) m_comm->close_socket(m_master_addr);

Definition at line 44 of file ClientConnectionHandler.cc.

Member Function Documentation

void ClientConnectionHandler::close ( )

Definition at line 101 of file ClientConnectionHandler.cc.

void Hyperspace::ClientConnectionHandler::disable_callbacks ( )
inline

Definition at line 84 of file ClientConnectionHandler.h.

bool Hyperspace::ClientConnectionHandler::disconnected ( )
inline

Definition at line 54 of file ClientConnectionHandler.h.

void ClientConnectionHandler::handle ( Hypertable::EventPtr event_ptr)
virtual

Callback method.

When the Comm layer needs to deliver an event to the application, this method is called to do so. The set of event types include, CONNECTION_ESTABLISHED, DISCONNECT, MESSAGE, ERROR, and TIMER.

Parameters
event_ptrsmart pointer to Event object

Implements Hypertable::DispatchHandler.

Definition at line 52 of file ClientConnectionHandler.cc.

int Hyperspace::ClientConnectionHandler::initiate_connection ( struct sockaddr_in &  addr)
inline

Definition at line 59 of file ClientConnectionHandler.h.

void Hyperspace::ClientConnectionHandler::set_session_id ( uint64_t  id)
inline

Definition at line 52 of file ClientConnectionHandler.h.

void Hyperspace::ClientConnectionHandler::set_verbose_mode ( bool  verbose)
inline

Definition at line 82 of file ClientConnectionHandler.h.

Member Data Documentation

bool Hyperspace::ClientConnectionHandler::m_callbacks_enabled {}
private

Definition at line 98 of file ClientConnectionHandler.h.

Comm* Hyperspace::ClientConnectionHandler::m_comm {}
private

Definition at line 91 of file ClientConnectionHandler.h.

std::condition_variable_any Hyperspace::ClientConnectionHandler::m_cond
private

Definition at line 90 of file ClientConnectionHandler.h.

struct sockaddr_in Hyperspace::ClientConnectionHandler::m_master_addr
private

Definition at line 95 of file ClientConnectionHandler.h.

std::recursive_mutex Hyperspace::ClientConnectionHandler::m_mutex
private

Definition at line 89 of file ClientConnectionHandler.h.

Session* Hyperspace::ClientConnectionHandler::m_session {}
private

Definition at line 92 of file ClientConnectionHandler.h.

uint64_t Hyperspace::ClientConnectionHandler::m_session_id {}
private

Definition at line 93 of file ClientConnectionHandler.h.

int Hyperspace::ClientConnectionHandler::m_state {}
private

Definition at line 94 of file ClientConnectionHandler.h.

uint32_t Hyperspace::ClientConnectionHandler::m_timeout_ms {}
private

Definition at line 96 of file ClientConnectionHandler.h.

bool Hyperspace::ClientConnectionHandler::m_verbose {}
private

Definition at line 97 of file ClientConnectionHandler.h.


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