Skip to content

Commit

Permalink
add a number of new data size
Browse files Browse the repository at this point in the history
  • Loading branch information
gaochundong committed Jan 6, 2017
1 parent 4cadcd1 commit 2fc87ec
Show file tree
Hide file tree
Showing 7 changed files with 163 additions and 43 deletions.
28 changes: 23 additions & 5 deletions Cowboy/Tests/Cowboy.Sockets.TestAsyncTcpSocketClient/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,27 +53,45 @@ static void Main(string[] args)
Console.WriteLine("Client [{0}] send text -> [{1}].", _client.LocalEndPoint, text);
}
}
else if (text == "big1")
else if (text == "big1k")
{
text = new string('x', 1024 * 1);
await _client.SendAsync(Encoding.UTF8.GetBytes(text));
Console.WriteLine("Client [{0}] send text -> [{1} Bytes].", _client.LocalEndPoint, text.Length);
}
else if (text == "big10k")
{
text = new string('x', 1024 * 10);
await _client.SendAsync(Encoding.UTF8.GetBytes(text));
Console.WriteLine("Client [{0}] send text -> [{1} Bytes].", _client.LocalEndPoint, text.Length);
}
else if (text == "big100k")
{
text = new string('x', 1024 * 100);
await _client.SendAsync(Encoding.UTF8.GetBytes(text));
Console.WriteLine("Client [{0}] send text -> [{1} Bytes].", _client.LocalEndPoint, text.Length);
}
else if (text == "big1m")
{
text = new string('x', 1024 * 1024 * 1);
await _client.SendAsync(Encoding.UTF8.GetBytes(text));
Console.WriteLine("Client [{0}] send text -> [{1} Bytes].", _client.LocalEndPoint, text.Length);
}
else if (text == "big10")
else if (text == "big10m")
{
text = new string('x', 1024 * 1024 * 10);
await _client.SendAsync(Encoding.UTF8.GetBytes(text));
Console.WriteLine("Client [{0}] send text -> [{1} Bytes].", _client.LocalEndPoint, text.Length);
}
else if (text == "big100")
else if (text == "big100m")
{
text = new string('x', 1024 * 1024 * 100);
await _client.SendAsync(Encoding.UTF8.GetBytes(text));
Console.WriteLine("Client [{0}] send text -> [{1} Bytes].", _client.LocalEndPoint, text.Length);
}
else if (text == "big1000")
else if (text == "big1g")
{
text = new string('x', 1024 * 1024 * 1000);
text = new string('x', 1024 * 1024 * 1024);
await _client.SendAsync(Encoding.UTF8.GetBytes(text));
Console.WriteLine("Client [{0}] send text -> [{1} Bytes].", _client.LocalEndPoint, text.Length);
}
Expand Down
28 changes: 23 additions & 5 deletions Cowboy/Tests/Cowboy.Sockets.TestAsyncTcpSocketServer/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,27 +50,45 @@ static void Main(string[] args)
Console.WriteLine("Server [{0}] broadcasts text -> [{1}].", _server.ListenedEndPoint, text);
}
}
else if (text == "big1")
else if (text == "big1k")
{
text = new string('x', 1024 * 1);
await _server.BroadcastAsync(Encoding.UTF8.GetBytes(text));
Console.WriteLine("Server [{0}] broadcasts text -> [{1} Bytes].", _server.ListenedEndPoint, text.Length);
}
else if (text == "big10k")
{
text = new string('x', 1024 * 10);
await _server.BroadcastAsync(Encoding.UTF8.GetBytes(text));
Console.WriteLine("Server [{0}] broadcasts text -> [{1} Bytes].", _server.ListenedEndPoint, text.Length);
}
else if (text == "big100k")
{
text = new string('x', 1024 * 100);
await _server.BroadcastAsync(Encoding.UTF8.GetBytes(text));
Console.WriteLine("Server [{0}] broadcasts text -> [{1} Bytes].", _server.ListenedEndPoint, text.Length);
}
else if (text == "big1m")
{
text = new string('x', 1024 * 1024 * 1);
await _server.BroadcastAsync(Encoding.UTF8.GetBytes(text));
Console.WriteLine("Server [{0}] broadcasts text -> [{1} Bytes].", _server.ListenedEndPoint, text.Length);
}
else if (text == "big10")
else if (text == "big10m")
{
text = new string('x', 1024 * 1024 * 10);
await _server.BroadcastAsync(Encoding.UTF8.GetBytes(text));
Console.WriteLine("Server [{0}] broadcasts text -> [{1} Bytes].", _server.ListenedEndPoint, text.Length);
}
else if (text == "big100")
else if (text == "big100m")
{
text = new string('x', 1024 * 1024 * 100);
await _server.BroadcastAsync(Encoding.UTF8.GetBytes(text));
Console.WriteLine("Server [{0}] broadcasts text -> [{1} Bytes].", _server.ListenedEndPoint, text.Length);
}
else if (text == "big1000")
else if (text == "big1g")
{
text = new string('x', 1024 * 1024 * 1000);
text = new string('x', 1024 * 1024 * 1024);
await _server.BroadcastAsync(Encoding.UTF8.GetBytes(text));
Console.WriteLine("Server [{0}] broadcasts text -> [{1} Bytes].", _server.ListenedEndPoint, text.Length);
}
Expand Down
33 changes: 24 additions & 9 deletions Cowboy/Tests/Cowboy.Sockets.TestTcpSocketClient/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,44 +34,59 @@ static void Main(string[] args)
_client.Send(Encoding.UTF8.GetBytes(text));
}
}
else if (text == "big1")
else if (text == "big1k")
{
text = new string('x', 1024 * 1);
_client.Send(Encoding.UTF8.GetBytes(text));
}
else if (text == "big10k")
{
text = new string('x', 1024 * 10);
_client.Send(Encoding.UTF8.GetBytes(text));
}
else if (text == "big100k")
{
text = new string('x', 1024 * 100);
_client.Send(Encoding.UTF8.GetBytes(text));
}
else if (text == "big1m")
{
text = new string('x', 1024 * 1024 * 1);
_client.Send(Encoding.UTF8.GetBytes(text));
}
else if (text == "big2")
else if (text == "big2m")
{
text = new string('x', 1024 * 1024 * 2);
_client.Send(Encoding.UTF8.GetBytes(text));
}
else if (text == "big5")
else if (text == "big5m")
{
text = new string('x', 1024 * 1024 * 5);
_client.Send(Encoding.UTF8.GetBytes(text));
}
else if (text == "big10")
else if (text == "big10m")
{
text = new string('x', 1024 * 1024 * 10);
_client.Send(Encoding.UTF8.GetBytes(text));
}
else if (text == "big20")
else if (text == "big20m")
{
text = new string('x', 1024 * 1024 * 20);
_client.Send(Encoding.UTF8.GetBytes(text));
}
else if (text == "big50")
else if (text == "big50m")
{
text = new string('x', 1024 * 1024 * 50);
_client.Send(Encoding.UTF8.GetBytes(text));
}
else if (text == "big100")
else if (text == "big100m")
{
text = new string('x', 1024 * 1024 * 100);
_client.Send(Encoding.UTF8.GetBytes(text));
}
else if (text == "big1000")
else if (text == "big1g")
{
text = new string('x', 1024 * 1024 * 1000);
text = new string('x', 1024 * 1024 * 1024);
_client.Send(Encoding.UTF8.GetBytes(text));
}
else
Expand Down
28 changes: 23 additions & 5 deletions Cowboy/Tests/Cowboy.Sockets.TestTcpSocketRioServer/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,27 +48,45 @@ static void Main(string[] args)
Console.WriteLine("Server [{0}] broadcasts text -> [{1}].", _server.ListenedEndPoint, text);
}
}
else if (text == "big1")
else if (text == "big1k")
{
text = new string('x', 1024 * 1);
await _server.BroadcastAsync(Encoding.UTF8.GetBytes(text));
Console.WriteLine("Server [{0}] broadcasts text -> [{1} Bytes].", _server.ListenedEndPoint, text.Length);
}
else if (text == "big10k")
{
text = new string('x', 1024 * 10);
await _server.BroadcastAsync(Encoding.UTF8.GetBytes(text));
Console.WriteLine("Server [{0}] broadcasts text -> [{1} Bytes].", _server.ListenedEndPoint, text.Length);
}
else if (text == "big100k")
{
text = new string('x', 1024 * 100);
await _server.BroadcastAsync(Encoding.UTF8.GetBytes(text));
Console.WriteLine("Server [{0}] broadcasts text -> [{1} Bytes].", _server.ListenedEndPoint, text.Length);
}
else if (text == "big1m")
{
text = new string('x', 1024 * 1024 * 1);
await _server.BroadcastAsync(Encoding.UTF8.GetBytes(text));
Console.WriteLine("Server [{0}] broadcasts text -> [{1} Bytes].", _server.ListenedEndPoint, text.Length);
}
else if (text == "big10")
else if (text == "big10m")
{
text = new string('x', 1024 * 1024 * 10);
await _server.BroadcastAsync(Encoding.UTF8.GetBytes(text));
Console.WriteLine("Server [{0}] broadcasts text -> [{1} Bytes].", _server.ListenedEndPoint, text.Length);
}
else if (text == "big100")
else if (text == "big100m")
{
text = new string('x', 1024 * 1024 * 100);
await _server.BroadcastAsync(Encoding.UTF8.GetBytes(text));
Console.WriteLine("Server [{0}] broadcasts text -> [{1} Bytes].", _server.ListenedEndPoint, text.Length);
}
else if (text == "big1000")
else if (text == "big1g")
{
text = new string('x', 1024 * 1024 * 1000);
text = new string('x', 1024 * 1024 * 1024);
await _server.BroadcastAsync(Encoding.UTF8.GetBytes(text));
Console.WriteLine("Server [{0}] broadcasts text -> [{1} Bytes].", _server.ListenedEndPoint, text.Length);
}
Expand Down
28 changes: 23 additions & 5 deletions Cowboy/Tests/Cowboy.Sockets.TestTcpSocketSaeaClient/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,27 +49,45 @@ static void Main(string[] args)
Console.WriteLine("Client [{0}] send text -> [{1}].", _client.LocalEndPoint, text);
}
}
else if (text == "big1")
else if (text == "big1k")
{
text = new string('x', 1024 * 1);
await _client.SendAsync(Encoding.UTF8.GetBytes(text));
Console.WriteLine("Client [{0}] send text -> [{1} Bytes].", _client.LocalEndPoint, text.Length);
}
else if (text == "big10k")
{
text = new string('x', 1024 * 10);
await _client.SendAsync(Encoding.UTF8.GetBytes(text));
Console.WriteLine("Client [{0}] send text -> [{1} Bytes].", _client.LocalEndPoint, text.Length);
}
else if (text == "big100k")
{
text = new string('x', 1024 * 100);
await _client.SendAsync(Encoding.UTF8.GetBytes(text));
Console.WriteLine("Client [{0}] send text -> [{1} Bytes].", _client.LocalEndPoint, text.Length);
}
else if (text == "big1m")
{
text = new string('x', 1024 * 1024 * 1);
await _client.SendAsync(Encoding.UTF8.GetBytes(text));
Console.WriteLine("Client [{0}] send text -> [{1} Bytes].", _client.LocalEndPoint, text.Length);
}
else if (text == "big10")
else if (text == "big10m")
{
text = new string('x', 1024 * 1024 * 10);
await _client.SendAsync(Encoding.UTF8.GetBytes(text));
Console.WriteLine("Client [{0}] send text -> [{1} Bytes].", _client.LocalEndPoint, text.Length);
}
else if (text == "big100")
else if (text == "big100m")
{
text = new string('x', 1024 * 1024 * 100);
await _client.SendAsync(Encoding.UTF8.GetBytes(text));
Console.WriteLine("Client [{0}] send text -> [{1} Bytes].", _client.LocalEndPoint, text.Length);
}
else if (text == "big1000")
else if (text == "big1g")
{
text = new string('x', 1024 * 1024 * 1000);
text = new string('x', 1024 * 1024 * 1024);
await _client.SendAsync(Encoding.UTF8.GetBytes(text));
Console.WriteLine("Client [{0}] send text -> [{1} Bytes].", _client.LocalEndPoint, text.Length);
}
Expand Down
28 changes: 23 additions & 5 deletions Cowboy/Tests/Cowboy.Sockets.TestTcpSocketSaeaServer/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,27 +47,45 @@ static void Main(string[] args)
Console.WriteLine("Server [{0}] broadcasts text -> [{1}].", _server.ListenedEndPoint, text);
}
}
else if (text == "big1")
else if (text == "big1k")
{
text = new string('x', 1024 * 1);
await _server.BroadcastAsync(Encoding.UTF8.GetBytes(text));
Console.WriteLine("Server [{0}] broadcasts text -> [{1} Bytes].", _server.ListenedEndPoint, text.Length);
}
else if (text == "big10k")
{
text = new string('x', 1024 * 10);
await _server.BroadcastAsync(Encoding.UTF8.GetBytes(text));
Console.WriteLine("Server [{0}] broadcasts text -> [{1} Bytes].", _server.ListenedEndPoint, text.Length);
}
else if (text == "big100k")
{
text = new string('x', 1024 * 100);
await _server.BroadcastAsync(Encoding.UTF8.GetBytes(text));
Console.WriteLine("Server [{0}] broadcasts text -> [{1} Bytes].", _server.ListenedEndPoint, text.Length);
}
else if (text == "big1m")
{
text = new string('x', 1024 * 1024 * 1);
await _server.BroadcastAsync(Encoding.UTF8.GetBytes(text));
Console.WriteLine("Server [{0}] broadcasts text -> [{1} Bytes].", _server.ListenedEndPoint, text.Length);
}
else if (text == "big10")
else if (text == "big10m")
{
text = new string('x', 1024 * 1024 * 10);
await _server.BroadcastAsync(Encoding.UTF8.GetBytes(text));
Console.WriteLine("Server [{0}] broadcasts text -> [{1} Bytes].", _server.ListenedEndPoint, text.Length);
}
else if (text == "big100")
else if (text == "big100m")
{
text = new string('x', 1024 * 1024 * 100);
await _server.BroadcastAsync(Encoding.UTF8.GetBytes(text));
Console.WriteLine("Server [{0}] broadcasts text -> [{1} Bytes].", _server.ListenedEndPoint, text.Length);
}
else if (text == "big1000")
else if (text == "big1g")
{
text = new string('x', 1024 * 1024 * 1000);
text = new string('x', 1024 * 1024 * 1024);
await _server.BroadcastAsync(Encoding.UTF8.GetBytes(text));
Console.WriteLine("Server [{0}] broadcasts text -> [{1} Bytes].", _server.ListenedEndPoint, text.Length);
}
Expand Down
Loading

0 comments on commit 2fc87ec

Please sign in to comment.