Comments (3)
I'm running into this too (I think?), using socketioxide 0.8 (I'm using warp 0.3), acting as a server for the openHAB cloud connector (source).
The cloud connector responds to proxy requests from the socketio server by sending a responseHeader
event, followed by one or more responseContentBinary
events, terminated with a responseFinished
event. When making a request, I usually see ordering (from the socketioxide server's perspective) like:
responseHeader
responseContentBinary
responseContentBinary
responseContentBinary
responseFinished
responseContentBinary
I'm not sure this is exactly the same problem: I don't think ACKs are involved at all (none of the events sent require ACKs), and it's the binary events themselves that are received by my application that are out of order, not the ACKs.
If I tell tokio to use the current_thread
runtime, the problem goes away.
from socketioxide.
The main problem comes from here:
socketioxide/engineioxide/src/socket.rs
Line 198 in 3ab5cd7
My two main options for this are:
- Putting a
Mutex
here but it would be quite bad because most of the time it is single message packet that is sent and therefore it doesn't require any locking / ordering. - Modifying the channel so that it takes a
Vec<Packet>
rather than aPacket
. Adjacent binary packets would be grouped in each Vec. But most of theVec<Packet>
would be of size 1 and it would cause many newVec
alloc.
from socketioxide.
Hm, maybe that's not the same problem I'm seeing then. If I understand this bit of code correctly, that's for packets that are being sent out from the socketioxide server to the client. For me, I'm seeing messages in the other direction that are out of order. Which, now that I read through the engineioxide/socketioxide code some more, I don't quite understand how that could be happening, as it looks like the event is handled and sent up to the application on the same thread as it's received on from the websocket, without any queuing. So maybe the fault is in my code...
from socketioxide.
Related Issues (20)
- Automatic crate publishing
- Custom parser support HOT 2
- Feature reqwest: List all rooms HOT 1
- Using TLS to encrypt all messages HOT 2
- WebTransport support HOT 1
- Socket-io client does not upgrade to Websocket, it just works as polling HOT 3
- Add middlewares services to namespaces
- All events get blocked when socket is emitting lots of data HOT 14
- Several handlers for a single event HOT 2
- Binary packet placeholder handling does not handle all possible messages
- Relationship between `Bin` and the structure of `Data` can be ambiguous for binary packets HOT 14
- Binary events sent to handlers have a 0x4 byte prepended to the binary data (v4 server) HOT 2
- `OPTIONS` request should not return `BadHandshakeMethod` error HOT 1
- Add default event "connection" HOT 1
- Cannot keep ref to extension objects across .await points in handlers/middlewares HOT 3
- delete_ns blocks thread indefinitely HOT 1
- MongoDB Adpter HOT 1
- Hold a per `Client` state rather than a static state. HOT 1
- Unnecessary panic on Message enum match arms HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from socketioxide.