I have already read through multiple posts on Websockets
which highlights the fact that Websockets
run on top on TCP Connection
and the order is guaranteed. Since, I am new to `Websockets', I have a small query.
I have a simple application in which I am trying to send a large file (1GB) over a websocket connection. I am using rails gem
named websocket-rails
on server end and their java script
client on front end.
I have created a private channel over which events are fired and date is transmitted one after the other. I transfer 500 lines' at a time from
server to client' over the same channel as a part of the same websocket connection. Is there a possibility that the packets may arrive at different order by any chance ? Do I need to implement any mechanism to re-order
the entire file on the client end?
Websockets have no "events" or "channels". They have only messages which are transported as one or multiple frames. The order of the messages and the frames inside the messages stays the same, i.e. no reordering is done and no interleaving with other messages (control frames might interleave).
How this translates to your "private channel" and "events" is unknown since this might be features of a specific library you are using on top of Websockets.