Client Socket.io acknowledgement for server

Asked

Viewed 51 times

1

I know it is possible to use callback functions in socket.io, an example is found in the link http://socket.io/docs

EXAMPLE

Client

socket.emit('ferret', 'tobi', function (data) {
    console.log(data); 
});

Server

socket.on('ferret', function (name, fn) {
    fn('woot');
});

In this case, the function of callback has the following address: server to client

What I’m trying unsuccessfully is that the function of callback work from client to server

Thank you

  • I only found a report that the server confirmation for the client does not work when the event has no parameters: https://github.com/Automattic/socket.io/issues/1172

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.