socketIO-client icon indicating copy to clipboard operation
socketIO-client copied to clipboard

Emit with callback seems not work.

Open specialshoot opened this issue 8 years ago • 2 comments

I run the demo that README show.Logger shows what I write in socketio website.But the callback doesn't show anything in terminal. socketIO-client 0.7.0 OS:Ubuntu14.04

specialshoot avatar Aug 15 '16 13:08 specialshoot

`# -- coding:utf-8 --

from socketIO_client import SocketIO,LoggingNamespace import logging

logging.basicConfig(level=logging.DEBUG)

def on_aaa_response(*args): print 'enter' print('on_aaa_response',args)

baseurl="http://119.29.174.145" with SocketIO(baseurl,3000,LoggingNamespace) as socketIO: #Listen socketIO.on('new-tx',on_aaa_response) socketIO.emit('aaa') socketIO.wait()`

Logger show what I type in socketio website.But this code doesn't enter "on_aaa_response" method

specialshoot avatar Aug 15 '16 13:08 specialshoot

Just because no one respond before:

You emit on 'aaa' and listen on 'new-tx' so it's not working. you need the same identifier: socketIO.on('aaa',on_aaa_response) socketIO.emit('aaa')

AMontagu avatar Jul 12 '17 09:07 AMontagu