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
In Packet.encode() needs_comma is ignored if self.id and data are both None. If a namespace is used and there is no data, the encoded packet might look something like 1/namespace, without a trailing comma.
<packet type>[<# of binary attachments>-][<namespace>,][<acknowledgment id>][JSON-stringified payload without binary]
This is further backed up by the examples, i.e. in the DISCONNECT example: 1/admin,. The same behaviour can be seen in socket.io.js encodeAsString(), where the comma is always appended (if the namespace is not empty and not /).
It seems like a small change that would simplify packet.py, but I don't know whether other parts of the code depend on the current behaviour.
The text was updated successfully, but these errors were encountered:
Hi,
In Packet.encode()
needs_comma
is ignored ifself.id
anddata
are both None. If a namespace is used and there is no data, the encoded packet might look something like1/namespace
, without a trailing comma.However, the socket.io-protocol readme defines the comma as part of the message:
This is further backed up by the examples, i.e. in the
DISCONNECT
example:1/admin,
. The same behaviour can be seen in socket.io.js encodeAsString(), where the comma is always appended (if the namespace is not empty and not/
).It seems like a small change that would simplify packet.py, but I don't know whether other parts of the code depend on the current behaviour.
The text was updated successfully, but these errors were encountered: