在JS socket.io中,客户端的emit函数中有第三个参数:
client.emit("event name",{some:"data"},function myack(value){
})
myack
函数被传递到服务器,并使用一些返回值进行调用:
//server side:
myack("foobar");
...
但是,我在pythonsocket.io中没有看到这个特性:https://python-socketio.readthedocs.io/en/latest/api.html#asyncserver-class
ack
函数能否从客户端JS socket.io传递到Python socket.io服务器?应该使用相同的应用程序协议
为了简化Gijs Wobben的回答:
客户端:
服务器端:
是的,您可以看一下文档: https://python-socketio.readthedocs.io/en/latest/server.html#event-callbacks
从这些文件中:
因此:
相关问题 更多 >
编程相关推荐