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
socket.send('hello',newBuffer('1234'));// results in the following packetvarpacket={type: 5,data: ['hello',<buffer>],
nsp: '/',
// id: <id> (if used with an acknowledgement)
};// that gets encoded as two packets by socket.io-parser[encodeAsString(packetWithoutBuffer),<buffer>
]
The thing is, those two packets are sent as two different frames (here), which isn't really efficient (even if a websocket emit does not need a new TCP handshake).
One possible solution would be to concatenate those two packets in one buffer:
var stringPacket = encodeAsString(packetWithoutBuffer);
<stringPacket length><stringPacket as buffer><buffer>
Yet that would be a breaking change, and a special case when handling binary data.
As described here, currently:
The thing is, those two packets are sent as two different frames (here), which isn't really efficient (even if a websocket emit does not need a new TCP handshake).
One possible solution would be to concatenate those two packets in one buffer:
Yet that would be a breaking change, and a special case when handling binary data.
Related:
The text was updated successfully, but these errors were encountered: