Skip to content

Commit

Permalink
fix. FixUdp.SendAndReceive. (macOs | Linux)
Browse files Browse the repository at this point in the history
  • Loading branch information
alec1o committed Jun 30, 2024
1 parent 2f4b66f commit f909f96
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions test/udp/FixUdp.SendAndReceive.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
public partial class FixUdp
{
[Fact]
public async Task SendAndReceive()
public void SendAndReceive()
{
await Server();
Server();

async Task Server()
void Server()
{
var host = HostManager.GenerateLocalHost();

Expand Down Expand Up @@ -55,7 +55,7 @@ async Task Server()
Assert.False(isModify);
}

await server.To.Open(host);
server.To.Open(host).Wait();

Thread.Sleep(millisecondsTimeout: 100);
{
Expand All @@ -70,17 +70,17 @@ async Task Server()

for (int i = 0; i < maxConnection; i++)
{
await Client(server.Host);
Client(server.Host);
}

Thread.Sleep(300);
Thread.Sleep(1000);

Assert.Equal(maxConnection, server.Clients.Length);
Assert.Equal(maxConnection, allDataReceived);
Assert.Equal(maxConnection, allEventReceived);
}

async Task Client(Host host)
void Client(Host host)
{
UDP.Client client = new();

Expand Down Expand Up @@ -110,7 +110,7 @@ async Task Client(Host host)
Assert.Empty(eventReceived.data); // event
}

await client.To.Open(host);
client.To.Open(host).Wait();

client.To.Data(dataSent);
client.To.Event(eventSent.name, eventSent.data);
Expand Down

0 comments on commit f909f96

Please sign in to comment.