Replies: 9 comments
-
Binary messages are passed on to handlers in the same way as regular JSON messages. Are you familiar with the Socket.IO protocol? |
Beta Was this translation helpful? Give feedback.
-
I'm learning, can you give me an example? |
Beta Was this translation helpful? Give feedback.
-
@evehaxor there is no difference between binary and non-binary data. Just use a bytes object for your binary packets. You can send just a binary payload, or you can combine JSON with binary, both work. |
Beta Was this translation helpful? Give feedback.
-
I don't know how to interpret binary messages in python
it works but how do I do binary messages? thanks for listening |
Beta Was this translation helpful? Give feedback.
-
There are no changes to your code for binary data. The |
Beta Was this translation helpful? Give feedback.
-
Emitting event "message" [/stock] hi,what does {"_placeholder":true,"num":0} mean?? sio.emit(event='trdCmd', data=b'\x08\x05\x10h*\x1b\x12\x0860000011\x1a\x06123456J\x071.7.7.7', namespace="/stock") this is mye code and i can't Received anything |
Beta Was this translation helpful? Give feedback.
-
@fcy197778770 the placeholder is where the binary data goes. This data is sent in a follow up package. Read the socket.io protocol documentation if you are interested in the internals. |
Beta Was this translation helpful? Give feedback.
-
@miguelgrinberg Hi, I checked the log,I did send sessages and the server received a message. |
Beta Was this translation helpful? Give feedback.
-
@fcy197778770 This is not a log that comes from this package, so I don't know how to interpret it. Please create a small server and client application that I can use to reproduce the problem here. |
Beta Was this translation helpful? Give feedback.
-
Hello, How do I interpret binary packages using the socket.io module?
python-engineio 3.14.2
python-socketio 4.6.0
Beta Was this translation helpful? Give feedback.
All reactions