When stress testing websocket-sharp-server with intensive data transfer (mostly from server to client), I have noticed that Ping (from server to the client), however executing "internal bool Ping (byte[] frameAsBytes, TimeSpan timeout)" and its "sendBytes(frameAsBytes)", does not actually sent the Ping for very long time. The time is so long that the Sweep terminates the socket soon afterwards.
My test is using short binary (14 bytes) messages (x 1000) passed via "public void Send (byte[] data)". Both "internal bool Ping(byte[] frameAsBytes, TimeSpan timeout)" and "private bool send(Opcode opcode, Stream stream)" finish in sendBytes(), which in turn writes to the same "_stream". If the stream is containing large number of data, then the appended "Ping frame" will wait until the buffer reaches it. In the meantime the Sweep fails. This would mean that the websocket cannot be used in heavy data usage, or I will have to wait on every (every some) call to Send, for the _stream to be empty. This to make sure the upcoming "Ping frame" has priority.
Is my observation correct? How to control the flow the best way, not to disturb the websocket protocol, and not to abuse the _stream?
I have code base marked as 1.0.2.* checkout 91 days ago.
When stress testing websocket-sharp-server with intensive data transfer (mostly from server to client), I have noticed that Ping (from server to the client), however executing "internal bool Ping (byte[] frameAsBytes, TimeSpan timeout)" and its "sendBytes(frameAsBytes)", does not actually sent the Ping for very long time. The time is so long that the Sweep terminates the socket soon afterwards.
My test is using short binary (14 bytes) messages (x 1000) passed via "public void Send (byte[] data)". Both "internal bool Ping(byte[] frameAsBytes, TimeSpan timeout)" and "private bool send(Opcode opcode, Stream stream)" finish in sendBytes(), which in turn writes to the same "_stream". If the stream is containing large number of data, then the appended "Ping frame" will wait until the buffer reaches it. In the meantime the Sweep fails. This would mean that the websocket cannot be used in heavy data usage, or I will have to wait on every (every some) call to Send, for the _stream to be empty. This to make sure the upcoming "Ping frame" has priority.
Is my observation correct? How to control the flow the best way, not to disturb the websocket protocol, and not to abuse the _stream?
I have code base marked as 1.0.2.* checkout 91 days ago.