PiraTa
PiraTa

Reputation: 485

socket.io client, doesn't emit message to server

var socket = io.connect('http://localhost:3001');


onClickEvent -> io.emit('test', 'testMessage');

I have this code. On click I'm emitting data to server. When I'm clicking to emit, from tab#1, it emitting properly. But When I'm clicking from tab #2, it doesn't emitting.

there is not any error, in console...

In both tabs, messages from server comes with no problem, but there is something wrong during emitting from client to server.

any idea?

Upvotes: 0

Views: 219

Answers (1)

Nivesh
Nivesh

Reputation: 2603

should work using:

socket.emit('test', 'testMessage');

Upvotes: 1

Related Questions