-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## [1.0.0-pre.10] - 2021-12-02 ### Fixes * On fragmented and reliable pipelines, sending a large packet when the reliable window was almost full could result in the packet being lost. * Fixed "pending sends" warning being emitted very often when sending to remote hosts.
- Loading branch information
Unity Technologies
committed
Dec 2, 2021
1 parent
e5c8ed9
commit c96ecc4
Showing
9 changed files
with
117 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
using NUnit.Framework; | ||
using Unity.Networking.Transport; | ||
using UnityEngine.TestTools; | ||
using System.Linq; | ||
|
||
namespace Unity.Networking.Transport.Tests | ||
{ | ||
public class BaselibNetworkInterfaceTests | ||
{ | ||
[Test] | ||
public unsafe void Baselib_Send_WaitForCompletion() | ||
{ | ||
var settings = new NetworkSettings(); | ||
settings.WithBaselibNetworkInterfaceParameters(sendQueueCapacity: 2000); | ||
|
||
using (var baselibInterface = new BaselibNetworkInterface()) | ||
{ | ||
baselibInterface.Initialize(settings); | ||
baselibInterface.CreateInterfaceEndPoint(NetworkEndPoint.AnyIpv4, out var endpoint); | ||
Assert.Zero(baselibInterface.Bind(endpoint)); | ||
|
||
// This tests is only valid when sending packets to a public IP. | ||
// So we use an invalid one: https://stackoverflow.com/questions/10456044/what-is-a-good-invalid-ip-address-to-use-for-unit-tests/ | ||
baselibInterface.CreateInterfaceEndPoint(NetworkEndPoint.Parse("192.0.2.0", 1234), out var destination); | ||
var queueHandle = default(NetworkSendQueueHandle); | ||
|
||
var sendInterface = baselibInterface.CreateSendInterface(); | ||
|
||
for (int i = 0; i < settings.GetBaselibNetworkInterfaceParameters().sendQueueCapacity; i++) | ||
{ | ||
sendInterface.BeginSendMessage.Ptr.Invoke(out var sendHandle, sendInterface.UserData, NetworkParameterConstants.MTU); | ||
sendHandle.size = sendHandle.capacity; | ||
var data = (byte*)sendHandle.data; | ||
for (int j = 0; j < sendHandle.size; j++) | ||
{ | ||
data[j] = (byte)j; | ||
} | ||
Assert.AreEqual(sendHandle.capacity, sendInterface.EndSendMessage.Ptr.Invoke(ref sendHandle, ref destination, sendInterface.UserData, ref queueHandle)); | ||
} | ||
|
||
baselibInterface.ScheduleSend(default, default).Complete(); | ||
|
||
LogAssert.NoUnexpectedReceived(); | ||
} | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters