Skip to content
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

Remove unnecessary decode from received package #158

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

oguzhanogreden
Copy link

@oguzhanogreden oguzhanogreden commented May 26, 2017

Fixes #155.

See here for why this works. Ultimately, my commit can lead to a bit more simplification of the code. Thought I'd leave that for @invisibleroads seeing that there is a 8.0.0 branch.

Nakroma added a commit to nexus-devs/socketIO-client-2.0.3 that referenced this pull request Jun 12, 2017
@Nakroma
Copy link

Nakroma commented Jun 12, 2017

Since this package doesn't seem to be worked on very much, I went ahead and forked it and implemented your fixes. For anyone interested working with 2.x you can use it with pip install socketIO-client-nexus while we wait for 8.0 or another package to add 2.x support.
https://github.com/nexus-devs/socketIO-client

@MisterWil
Copy link

This pull still has an issue with unicode handling in the _read_packet_text def in parsers.py. The last two lines need to pull the packet_text using the decoded contents and then re-encode the packet_text.

packet_text = content.decode()[content_index:content_index + packet_length]
return content_index + packet_length, packet_text.encode()

Nakroma added a commit to nexus-devs/socketIO-client-2.0.3 that referenced this pull request Jun 13, 2017
Copy link

@andresarcila andresarcila left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this worked for me, I upgraded Node from v0.42 to version 6.11.3 and my application in python stopped working. I applied this pull request and everything worked again

@lorcanoeire
Copy link

This worked for me, thanks. Node 6, npm "socket.io": "^2.0.3", python 3 socketIO-client-nexus==0.7.5

@AmazingRaise
Copy link

socketio/socket.io#2833
socket.io(version 2.0.x ):Merge Engine.IO and Socket.IO handshake packets; so read the packet error.It means do as Socket.IO do?

zheli pushed a commit to zheli/socketIO-client-2 that referenced this pull request Nov 12, 2017
@wilsonge
Copy link

wilsonge commented Jan 3, 2018

Out of interest does this fix the issue described in #129 (comment) ?

@BenWoodford
Copy link

@Nakroma I tried using the nexus package but was still getting the StopIteration error but only on Python >=3.5

I guess this issue is still up in the air?

@Nakroma
Copy link

Nakroma commented Jan 11, 2018

@BenWoodford could you give me a code snippet for reproduction? I'm on python 3.6.3 and it works for me

@BenWoodford
Copy link

Perhaps it’s a different issue with the same symptom then... I’m tinkering with the pyloopenergy library and that’s what’s throwing a StopIteration (as per this home-assistant/core#8137 (comment))

Hmm

@pavoni
Copy link

pavoni commented Jan 11, 2018

@BenWoodford @Nakroma In pyloopenergy we're using version 0.5.6 because the server we're talking to is socket.IO version 0.9

Don't know if the the same issue - and if so whether it's practical to port it back.

@JasXSL
Copy link

JasXSL commented Feb 20, 2018

@Nakroma I believe there's an issue with your fork where the connect/reconnect events are never raised. I added some further debugging and it seems like I'm only receiving packets of type 3 & 4

Edit: disconnect is actually being raised, just not connect/reconnect.

juhhov pushed a commit to PelionIoT/socketIO-client that referenced this pull request Aug 1, 2018
juhhov pushed a commit to PelionIoT/socketIO-client that referenced this pull request Aug 1, 2018
juhhov pushed a commit to PelionIoT/socketIO-client that referenced this pull request Aug 2, 2018
juhhov pushed a commit to PelionIoT/socketIO-client that referenced this pull request Aug 2, 2018
@nkruzan
Copy link

nkruzan commented Feb 21, 2023

this fix my issue connecting to cncjs. thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Socket.IO v2 support