-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes binary data sending #62
base: master
Are you sure you want to change the base?
Conversation
Binary data was not actually pointing to the correct uwsgi internal call when using the gevent loop engine.
flask_uwsgi_websocket/_gevent.py
Outdated
@@ -119,6 +126,7 @@ def listener(client): | |||
# should be able to ignore it anyway. | |||
while message: | |||
message = uwsgi.websocket_recv_nb() | |||
print(str(repr(message))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be nice to keep, can you wrap with a debug flag?
flask_uwsgi_websocket/_gevent.py
Outdated
@@ -68,10 +70,12 @@ def __call__(self, environ, start_response): | |||
|
|||
recv_event = Event() | |||
recv_queue = Queue() | |||
|
|||
is_binary = Event() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any reason to use an event vs boolean?
self.environ = environ | ||
self.fd = fd | ||
self.send_event = send_event | ||
self.send_queue = send_queue | ||
self.recv_event = recv_event | ||
self.recv_queue = recv_queue | ||
self.timeout = timeout | ||
self.timeout = 6000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not hardcode the timeout here :)
@@ -81,6 +85,7 @@ def __call__(self, environ, start_response): | |||
def listener(client): | |||
# wait max `client.timeout` seconds to allow ping to be sent | |||
select([client.fd], [], [], client.timeout) | |||
print('we received a message') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary logging.
@@ -68,10 +71,11 @@ def __call__(self, environ, start_response): | |||
|
|||
recv_event = Event() | |||
recv_queue = Queue() | |||
is_binary = Event() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still not clear why a boolean will not work here.
Binary data was not actually pointing to the correct uwsgi internal call when using the gevent loop engine.