Open DefinitlyEvil opened 7 years ago
I think I am running into this issue as well, is there a workaround?
Nah sry maybe it's just how WebSocket works to keep messages in order.
@DefinitlyEvil would commenting out the lock statements fix this at all?
@sta Do you have any input on this?
@deniskrop nope, I guess this protocol can't handle real-time data or big data.
@DefinitlyEvil Is there any way to modify it, or is there any implementation that does? I don't have any lag issues with an HTML5 + Javascript client that I wrote, but am seeing the lag in my Unity client using this library. Do you mean the whole websockets protocol or this library in particular? Some Unity multiplayer game examples use websockets-sharp and seem to run smoothly, not sure how accurate that is though. Could you point me in the right direction?
@deniskrop I meant the portocol, it is not suitable for huge data transmission. Well, there's no reason to fix it somehow, I just wrote my own thing. eg.: PACKET_HEADER(size and type) | PROTOBUF_ENCODED_DATA
currently each
Send()
will cause a lock to_forSend
, so the data will transmit like this:if multi-thread implemented, it should look like this:
but it may cause messages mis-ordered, maybe I should customize this protocol somehow.