discord-rpc-csharp icon indicating copy to clipboard operation
discord-rpc-csharp copied to clipboard

[BUG] PipeFrame.ReadStream() fails at times

Open ronfrigginjon opened this issue 3 years ago • 1 comments

Describe the bug This is happening on the message-listener branch PipeFrame.ReadStream() at times returns false when the byte[] result Length does not equal the stream length.

This is Logging an ERROR in ManagedNamedPiepClient.cs of "Pipe failed to read from the data received by the stream." as the ReadStream returns false and hits the else condition.

To Reproduce Steps to reproduce the behavior: This seems to be an intermittent problem and have yet found a way to reproduce it consistently. I am occasionally missing important messages from discord because of this issue.

Expected behavior The message to be read and enqueued

Desktop (please complete the following information):

  • OS: Windows 10
  • Framework: net45
  • Library Version: v2.0.50727

Logs Didn't send message INFO: Checking command queue INFO: Checking command queue TRCE: Ending Read TRCE: Read 2275 bytes ERR : Pipe failed to read from the data received by the stream. TRCE: Starting another read TRCE: Begining Read of 16384 bytes INFO: Checking command queue INFO: Checking command queue INFO: Checking command queue

Worked and sent the message INFO: Checking command queue TRCE: Ending Read TRCE: Read 1847 bytes TRCE: Read a frame: Frame TRCE: Starting another read TRCE: Begining Read of 16384 bytes TRCE: Read Payload: Frame INFO: Handling Response. Cmd: Dispatch, Event: MessageCreate TRCE: Incoming Message: @everyone Still plenty of spots available in our weekly bingo contest

ronfrigginjon avatar Jan 15 '22 16:01 ronfrigginjon

I have committed a small change that will make it not as strict when reading some messages. Please try this change.

Lachee avatar Mar 06 '22 03:03 Lachee

This issue was resolved. I was just able to increase the byte buffer min size from 2048 to 4096. Thanks for support

ronfrigginjon avatar Aug 19 '22 18:08 ronfrigginjon