Skip to content

Server side "connection" event triggered twice when a socket.io cpp client is connected #10

@jianjunz

Description

@jianjunz

If we add some log inside connection event handler, like

io.on('connection', function(){
  console.log('connection.');
});

It will output twice.

After a briefly investigation, I found socket.io cpp client sent a "connect" packet to the server after connection has been established. Server side seems to recognize it as a new connection. So "connection" event triggered twice.

Currently, I deleted

m_client->send(p);

from sio_socket.cpp (line 269). Then the second "connection" is gone. But I'm not sure if the "connect" packet is necessary or not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions