Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sending fragmented data causes IndexOutOfRangeException #6

Open
dylanpdx opened this issue Jan 4, 2021 · 0 comments
Open

Sending fragmented data causes IndexOutOfRangeException #6

dylanpdx opened this issue Jan 4, 2021 · 0 comments

Comments

@dylanpdx
Copy link

dylanpdx commented Jan 4, 2021

Hello,

I am having an odd issue where sending fragmented messages over the relay causes a IndexOutOfRangeException. Sending over fragmented channels works fine, but as soon as the message is too large and needs to be fragmented, issues occur.
This issue doesn't happen without the relay.

Sending a fragmented message from the Server to the Client causes this to be repeatedly output into the Relay server itself

[ERROR] Exception during loop: System.ArgumentException: Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.
   at System.ThrowHelper.ThrowArraySegmentCtorValidationFailedExceptions(Array array, Int32 offset, Int32 count)
   at MLAPI.Relay.Transports.UnetTransport.Poll(UInt64& connectionId, Byte& channelId, ArraySegment`1& payload) in C:\Users\dylanpdx\Source\Repos\MLAPI.Relay\MLAPI.Relay\Transports\UnetTransport.cs:line 44
   at MLAPI.Relay.Program.RunLoop() in C:\Users\dylanpdx\Source\Repos\MLAPI.Relay\MLAPI.Relay\Program.cs:line 241
   at MLAPI.Relay.Program.Main(String[] args) in C:\Users\dylanpdx\Source\Repos\MLAPI.Relay\MLAPI.Relay\Program.cs:line 221

Sending a fragmented message from a Client to the Server causes this to be repeatedly thrown into the Host PC (not the relay server)

IndexOutOfRangeException: Index was outside the bounds of the array.
MLAPI.Transports.UNET.RelayTransport.BaseReceive (UnityEngine.Networking.NetworkEventType event, System.Int32 hostId, System.Int32& connectionId, System.Int32& channelId, System.Byte[] buffer, System.Int32 bufferSize, System.Int32& receivedSize, System.Byte& error) (at <10b4ebfb14e04d6583eb858de486f4fc>:0)
MLAPI.Transports.UNET.RelayTransport.Receive (System.Int32& hostId, System.Int32& connectionId, System.Int32& channelId, System.Byte[] buffer, System.Int32 bufferSize, System.Int32& receivedSize, System.Byte& error) (at <10b4ebfb14e04d6583eb858de486f4fc>:0)
MLAPI.Transports.UNET.UnetTransport.PollEvent (System.UInt64& clientId, System.String& channelName, System.ArraySegment`1[System.Byte]& payload, System.Single& receiveTime) (at <10b4ebfb14e04d6583eb858de486f4fc>:0)
MLAPI.NetworkingManager.Update () (at <10b4ebfb14e04d6583eb858de486f4fc>:0)

I am using the UNET transport, and the config.json is configured correctly (no CRC errors). I've also made no changes to the source code, i've only compiled it and am running the server on Linux

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant