Connection & Broken Pipe Error?

632 views
Skip to first unread message

Michael Nguyen

unread,
Sep 26, 2013, 1:54:06 AM9/26/13
to gevent-...@googlegroups.com
Hi,

I'm new to python and gevent-socketio. I've been working on a game and I sometimes get an error that I can't figure out how to fix. Has anyone come across this error before?

File "/home/michael/monsterzoo/env/local/lib/python2.7/site-packages/geventwebsocket/websocket.py", line 244, in _receive
    frame = self.receive_frame()
  File "/home/michael/monsterzoo/env/local/lib/python2.7/site-packages/geventwebsocket/websocket.py", line 177, in receive_frame
    data0 = read(2)
  File "/home/michael/monsterzoo/env/local/lib/python2.7/site-packages/geventwebsocket/python_fixes.py", line 22, in readinto
    return self._sock.recv_into(b)
  File "/home/michael/monsterzoo/env/local/lib/python2.7/site-packages/gevent/socket.py", line 464, in recv_into
    return sock.recv_into(*args)
error: [Errno 110] Connection timed out
<Greenlet at 0x189af50: read_from_ws> failed with error

Traceback (most recent call last):
  File "/home/michael/monsterzoo/env/local/lib/python2.7/site-packages/gevent/greenlet.py", line 390, in run
    result = self._run(*self.args, **self.kwargs)
  File "/home/michael/monsterzoo/env/local/lib/python2.7/site-packages/socketio/transports.py", line 226, in send_into_ws
    websocket.send(message)
  File "/home/michael/monsterzoo/env/local/lib/python2.7/site-packages/geventwebsocket/websocket.py", line 350, in send
    return self.send_frame(message, self.OPCODE_TEXT)
  File "/home/michael/monsterzoo/env/local/lib/python2.7/site-packages/geventwebsocket/websocket.py", line 340, in send_frame
    self._write(combined)
  File "/home/michael/monsterzoo/env/local/lib/python2.7/site-packages/gevent/socket.py", line 509, in sendall
    data_sent += self.send(_get_memory(data, data_sent), flags)
  File "/home/michael/monsterzoo/env/local/lib/python2.7/site-packages/gevent/socket.py", line 483, in send
    return sock.send(data, flags)
error: [Errno 32] Broken pipe
<Greenlet at 0x14adb90: send_into_ws> failed with error

My code is located here: https://github.com/dyn4mik3/monsterzoo

Thanks for taking a look.

Dinh

unread,
Sep 26, 2013, 2:14:39 AM9/26/13
to gevent-...@googlegroups.com

Hi,

Broken pipe often caused by client disconnection. Sometimes it causes by consumer grade router or firewall

--
You received this message because you are subscribed to the Google Groups "gevent-socketio" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gevent-socket...@googlegroups.com.
To post to this group, send email to gevent-...@googlegroups.com.
Visit this group at http://groups.google.com/group/gevent-socketio.
For more options, visit https://groups.google.com/groups/opt_out.

Michael Nguyen

unread,
Sep 26, 2013, 2:04:38 PM9/26/13
to gevent-...@googlegroups.com
Thanks. What would be the right way to re-associate a new session with a user? I'm using Flask and have tried to access the Flask session within my Namespace, but I get this error:

File "/Library/Python/2.7/site-packages/gevent/greenlet.py", line 390, in run
    result = self._run(*self.args, **self.kwargs)
  File "/Library/Python/2.7/site-packages/socketio/virtsocket.py", line 353, in _receiver_loop
    pkt_ns.initialize()  # use this instead of __init__,
  File "/Users/michael/Dropbox/Code/game/game.py", line 168, in initialize
    if session['username']:
  File "/Library/Python/2.7/site-packages/werkzeug/local.py", line 368, in <lambda>
    __getitem__ = lambda x, i: x._get_current_object()[i]
  File "/Library/Python/2.7/site-packages/werkzeug/local.py", line 297, in _get_current_object
    return self.__local()
  File "/Library/Python/2.7/site-packages/flask/globals.py", line 20, in _lookup_req_object
    raise RuntimeError('working outside of request context')
RuntimeError: working outside of request context
<Greenlet at 0x109891370: <bound method Socket._receiver_loop of <socketio.virtsocket.Socket object at 0x109855b50>>> failed with RuntimeError


--
You received this message because you are subscribed to a topic in the Google Groups "gevent-socketio" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/gevent-socketio/70k-gN0R40E/unsubscribe.
To unsubscribe from this group and all its topics, send an email to gevent-socket...@googlegroups.com.

Elvio Rogelio Toccalino

unread,
Sep 26, 2013, 3:06:55 PM9/26/13
to gevent-...@googlegroups.com
I have come across such error before. It was in different contexts, and it never was critical, so I was never compelled to actually dig into it.


2013/9/26 Michael Nguyen <mic...@rubycowgames.com>
Reply all
Reply to author
Forward
0 new messages