You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fromflaskimportFlaskfromflask_socketioimportSocketIO, emitapp=Flask(__name__)
socketio=SocketIO(
app, manage_session=True, logger=True, engineio_logger=True,
async_mode='eventlet'
)
@socketio.on('connect')defconnect_handler(*args, **kwargs):
# !!! If do comment next line problem is not reproduced !!!emit('any_signal', {'data': 'Connected'})
if__name__=='__main__':
socketio.run(app, port=9999, log_output=True, debug=True)
Client:
importsignalfromsocketIO_clientimportSocketIOsignal.alarm(5) # kill self after 5 secondsconn=SocketIO('localhost', 9999)
conn.wait()
Logs:
/home/_/develop/ec-wss/.env/bin/python /home/_/develop/ec-wss/simple_server.py
Server initialized for eventlet.
* Restarting with stat
Server initialized for eventlet.
* Debugger is active!
* Debugger PIN: 407-346-791
(26666) wsgi starting up on http://127.0.0.1:9999
(26666) accepted ('127.0.0.1', 49774)
161f43bd70da42589172c840673d7608: Sending packet OPEN data {'sid': '161f43bd70da42589172c840673d7608', 'upgrades': ['websocket'], 'pingTimeout': 60000, 'pingInterval': 25000}
emitting event "any-signal" to 161f43bd70da42589172c840673d7608 [/]
161f43bd70da42589172c840673d7608: Sending packet MESSAGE data 2["any-signal",{"data":"Connected"}]
161f43bd70da42589172c840673d7608: Sending packet MESSAGE data 0
127.0.0.1 - - [20/Nov/2017 17:57:15] "GET /socket.io/?EIO=3&transport=polling&t=1511189835314-0 HTTP/1.1" 200 417 0.000877
(26666) accepted ('127.0.0.1', 49778)
161f43bd70da42589172c840673d7608: Received request to upgrade to websocket
Socket in CLOSE_WAIT state will never closed (until restart app). Looks like that upgrade to websocket is hung. It's can case DoS because open sockets is limited resource (in a product count of CLOSE_WAIT always grows :-().
The text was updated successfully, but these errors were encountered:
Can I ask you to retest with the git master branch of python-engineio? I'm getting the websocket connection upgraded successfully after the fix I just put in. Thanks!
Server:
Client:
Logs:
Socket state:
Issue:
Socket in CLOSE_WAIT state will never closed (until restart app). Looks like that upgrade to websocket is hung. It's can case DoS because open sockets is limited resource (in a product count of CLOSE_WAIT always grows :-().
The text was updated successfully, but these errors were encountered: