Bridges-C++  3.2.0
Bridges(C++API)
Public Types | Public Member Functions | Protected Member Functions | Friends | List of all members
sio::socket Class Reference

#include <sio_socket.h>

Public Types

typedef std::function< void(const std::string &name, message::ptr const &message, bool need_ack, message::list &ack_message)> event_listener_aux
 
typedef std::function< void(event &event)> event_listener
 
typedef std::function< void(message::ptr const &message)> error_listener
 
typedef std::shared_ptr< socketptr
 

Public Member Functions

 ~socket ()
 
void on (std::string const &event_name, event_listener const &func)
 
void on (std::string const &event_name, event_listener_aux const &func)
 
void off (std::string const &event_name)
 
void off_all ()
 
void close ()
 
void on_error (error_listener const &l)
 
void off_error ()
 
void emit (std::string const &name, message::list const &msglist=nullptr, std::function< void(message::list const &)> const &ack=nullptr)
 
std::string const & get_namespace () const
 

Protected Member Functions

 socket (client_impl *, std::string const &)
 
void on_connected ()
 
void on_close ()
 
void on_open ()
 
void on_disconnect ()
 
void on_message_packet (packet const &p)
 

Friends

class client_impl
 

Member Typedef Documentation

◆ error_listener

typedef std::function<void(message::ptr const& message)> sio::socket::error_listener

◆ event_listener

typedef std::function<void(event& event)> sio::socket::event_listener

◆ event_listener_aux

typedef std::function<void(const std::string& name, message::ptr const& message, bool need_ack, message::list& ack_message)> sio::socket::event_listener_aux

◆ ptr

typedef std::shared_ptr<socket> sio::socket::ptr

Constructor & Destructor Documentation

◆ ~socket()

sio::socket::~socket ( )

◆ socket()

sio::socket::socket ( client_impl ,
std::string const &   
)
protected

Member Function Documentation

◆ close()

void sio::socket::close ( )

◆ emit()

void sio::socket::emit ( std::string const &  name,
message::list const &  msglist = nullptr,
std::function< void(message::list const &)> const &  ack = nullptr 
)

◆ get_namespace()

std::string const& sio::socket::get_namespace ( ) const

◆ off()

void sio::socket::off ( std::string const &  event_name)

◆ off_all()

void sio::socket::off_all ( )

◆ off_error()

void sio::socket::off_error ( )

◆ on() [1/2]

void sio::socket::on ( std::string const &  event_name,
event_listener const &  func 
)

◆ on() [2/2]

void sio::socket::on ( std::string const &  event_name,
event_listener_aux const &  func 
)

◆ on_close()

void sio::socket::on_close ( )
protected

◆ on_connected()

void sio::socket::on_connected ( )
protected

◆ on_disconnect()

void sio::socket::on_disconnect ( )
protected

◆ on_error()

void sio::socket::on_error ( error_listener const &  l)

◆ on_message_packet()

void sio::socket::on_message_packet ( packet const &  p)
protected

◆ on_open()

void sio::socket::on_open ( )
protected

Friends And Related Function Documentation

◆ client_impl

friend class client_impl
friend

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