1

I use ws4py as a websocket server. it can run normally in Windows and Mac, but it runs in linux system raising a TB when websocket clients connect to server. Anybody can tell me how to fix this bug?

[2016-01-06 20:51:43,094] ERROR Failed to receive data
Traceback (most recent call last):
File "/home/yzliu/airtest/env/local/lib/python2.7/site-packages/ws4py/websocket.py", line 300, in once
    b = self.sock.recv(self.reading_buffer_size)
File "/home/yzliu/airtest/env/local/lib/python2.7/site-packages/gevent/_socket2.py", line 264, in recv
    return sock.recv(*args)
File "/home/yzliu/airtest/env/local/lib/python2.7/site-packages/gevent/_socket2.py", line 73, in _dummy
raise error(EBADF, 'Bad file descriptor')
ᴀʀᴍᴀɴ
  • 4,443
  • 8
  • 37
  • 57
huiji_Leung
  • 41
  • 1
  • 2

1 Answers1

0

This is a bug in ws4py, when used with gevent 1.1, as the underlying socket is closed when WSGI handler returns.

See: https://github.com/Lawouach/WebSocket-for-Python/pull/180/files

  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes – Roman Marusyk Mar 18 '16 at 11:02