Skip to content

Commit 26e8525

Browse files
committed
Add project files.
1 parent ea659b4 commit 26e8525

File tree

3 files changed

+105
-0
lines changed

3 files changed

+105
-0
lines changed

RelayServerTest.sln

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.3.32922.545
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RelayServer", "RelayServerTest\RelayServer.csproj", "{5CBE7822-5903-4733-8DDE-67E9A5A85F0C}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{5CBE7822-5903-4733-8DDE-67E9A5A85F0C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{5CBE7822-5903-4733-8DDE-67E9A5A85F0C}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{5CBE7822-5903-4733-8DDE-67E9A5A85F0C}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{5CBE7822-5903-4733-8DDE-67E9A5A85F0C}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {1AE0624D-E979-4B56-8E95-AB35A09B3BC3}
24+
EndGlobalSection
25+
EndGlobal

RelayServerTest/Program.cs

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
using NetworkLibrary.Components;
2+
using ProtoBuf;
3+
using Protobuff;
4+
using Protobuff.P2P;
5+
using System.Security.Cryptography.X509Certificates;
6+
7+
namespace RrlayServerTest
8+
{
9+
//KFtyEu7h6E
10+
internal class Program
11+
{
12+
[ProtoContract]
13+
public class PeerList
14+
{
15+
[ProtoMember(1)]
16+
public Guid asd;
17+
18+
19+
}
20+
static void Main(string[] args)
21+
{
22+
23+
var scert = new X509Certificate2("server.pfx", "greenpass");
24+
var server = new SecureProtoRelayServer(20011, 1000, scert);
25+
Task.Run(async () =>
26+
{
27+
while (true)
28+
{
29+
await Task.Delay(1000);
30+
server.GetTcpStatistics(out SessionStats generalStats, out var a);
31+
server.GetUdpStatistics(out UdpStatistics generalStatsU, out _);
32+
(int left,int right )=Console.GetCursorPosition();
33+
Console.Clear();
34+
Console.WriteLine("Session Count: "+a.Count);
35+
Console.WriteLine(generalStats.ToString());
36+
Console.WriteLine(generalStatsU.ToString());
37+
if(left != 0 && right != 0)
38+
Console.SetCursorPosition(left, right);
39+
}
40+
41+
});
42+
while (Console.ReadLine() != "e")
43+
{
44+
45+
}
46+
}
47+
}
48+
}

RelayServerTest/RelayServer.csproj

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net6.0</TargetFramework>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
</PropertyGroup>
9+
10+
<ItemGroup>
11+
<PackageReference Include="protobuf-net" Version="3.1.22" />
12+
</ItemGroup>
13+
14+
<ItemGroup>
15+
<Reference Include="NetworkLibrary">
16+
<HintPath>..\..\..\..\Desktop\NetworkExperiments\NetworkLibrary\bin\Release\netstandard2.0\NetworkLibrary.dll</HintPath>
17+
</Reference>
18+
<Reference Include="Protobuff">
19+
<HintPath>..\..\..\..\Desktop\NetworkExperiments\Protobuff\bin\Release\netstandard2.0\Protobuff.dll</HintPath>
20+
</Reference>
21+
</ItemGroup>
22+
23+
<ItemGroup>
24+
<None Update="client.pfx">
25+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
26+
</None>
27+
<None Update="server.pfx">
28+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
29+
</None>
30+
</ItemGroup>
31+
32+
</Project>

0 commit comments

Comments
 (0)