Python的socketIO客户端连接,然后断开连接
我想连接我的Python脚本到我的nodejs套接字服务器。 我的代码看起来像这样 –
节点js(相关部分) –
//using socket.io@2.0.3 //PORT 8008 io.on('connection', function(socket){ console.log('connected'); socket.on('disconnect', function(){ }); socket.on('message', function incoming(message){ console.log(message); var data=JSON.parse(message); console.log(data); socket.broadcast.emit('message', message); }); });
python脚本(相关部分) –
# using socketIO_client --0.7.2 socketIO = SocketIO('localhost', 8008) socketIO.wait()
我正在连接我的控制台,但之后,我得到错误(在Python方面) –
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python2.7/dist-packages/socketIO_client/__init__.py", line 353, in __init__ resource, hurry_interval_in_seconds, **kw) File "/usr/local/lib/python2.7/dist-packages/socketIO_client/__init__.py", line 54, in __init__ self._transport File "/usr/local/lib/python2.7/dist-packages/socketIO_client/__init__.py", line 62, in _transport self._engineIO_session = self._get_engineIO_session() File "/usr/local/lib/python2.7/dist-packages/socketIO_client/__init__.py", line 76, in _get_engineIO_session transport.recv_packet()) StopIteration
我GOOGLEsearch相关的东西,但没有到现在。
任何解决scheme,赞赏。
- 量angular器testing在重启后拿起边缘浏览器而不是铬
- 快速路由处理的pipe理员和pipe理员/ *具有相同的路线
- Node.js – 使用主/明细页面在Express中redirect
- Node.js / Express – 如何获取在path/ index.js app.js中定义的variables?
- search节点js数组与variables,返回索引或值进行部分匹配
- findOneAndUpdate()在upsert的值上返回null
- 错误:使用npm install with node.js v0.12.4时,套接字挂起
- dynamicFacebook元标记渲染使用创build反应的应用程序
- 在node.js服务器中定制bodyDecoder for Express