Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: socketio/socket.io-client-cpp
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: c00e9e318cf79355a6b908661d171a06107c5c60
Choose a base ref
..
head repository: socketio/socket.io-client-cpp
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 20ce61d7c05aa393d921c236efa86848c9273f2e
Choose a head ref
Showing with 9 additions and 5 deletions.
  1. +5 −5 src/internal/sio_client_impl.cpp
  2. +4 −0 src/internal/sio_client_impl.h
10 changes: 5 additions & 5 deletions src/internal/sio_client_impl.cpp
Original file line number Diff line number Diff line change
@@ -60,7 +60,7 @@ namespace sio
template<typename client_type>
client_impl<client_type>::~client_impl()
{
this->sockets_invoke_void(&sio::socket::on_close);
this->sockets_invoke_void(socket_on_close());
sync_close();
}

@@ -404,7 +404,7 @@ namespace sio
{
m_con.reset();
m_con_state = con_closed;
this->sockets_invoke_void(&sio::socket::on_disconnect);
this->sockets_invoke_void(socket_on_disconnect());
LOG("Connection failed." << endl);
if(m_reconn_made<m_reconn_attempts)
{
@@ -429,7 +429,7 @@ namespace sio
m_con_state = con_opened;
m_con = con;
m_reconn_made = 0;
this->sockets_invoke_void(&sio::socket::on_open);
this->sockets_invoke_void(socket_on_open());
this->socket("");
if(m_open_listener)m_open_listener();
}
@@ -455,12 +455,12 @@ namespace sio
client::close_reason reason;
if(code == close::status::normal)
{
this->sockets_invoke_void(&sio::socket::on_disconnect);
this->sockets_invoke_void(socket_on_disconnect());
reason = client::close_reason_normal;
}
else
{
this->sockets_invoke_void(&sio::socket::on_disconnect);
this->sockets_invoke_void(socket_on_disconnect());
if(m_reconn_made<m_reconn_attempts)
{
LOG("Reconnect for attempt:"<<m_reconn_made<<endl);
4 changes: 4 additions & 0 deletions src/internal/sio_client_impl.h
Original file line number Diff line number Diff line change
@@ -94,6 +94,10 @@ namespace sio
// Wrap protected member functions of sio::socket because only client_impl_base is friended.
sio::socket* new_socket(std::string const&);
void socket_on_message_packet(sio::socket::ptr&, packet const&);
typedef void (sio::socket::*socket_void_fn)(void);
inline socket_void_fn socket_on_close() { return &sio::socket::on_close; }
inline socket_void_fn socket_on_disconnect() { return &sio::socket::on_disconnect; }
inline socket_void_fn socket_on_open() { return &sio::socket::on_open; }
};

template<typename client_type>