Motivation
.NET Core tooling allows building for both .NET Framework and .NET Standard while easing pains of running tests and packaging.

Modifications
- csproj -> xproj + project.json
- support for .NET Standard 1.3
- build script is now based on CAKE
- using dotnet CLI for building, testing, packing
- strong name by default (snk included)

Result
DotNetty works on .NET Core and any other platform supporting .NET Standard 1.3+.
This commit is contained in:
Max Gortman 2016-11-07 17:50:24 -08:00 коммит произвёл GitHub
Родитель 6fc89419c8
Коммит 4f28a55b48
227 изменённых файлов: 3841 добавлений и 6103 удалений

7
.gitignore поставляемый
Просмотреть файл

@ -29,4 +29,9 @@ nuget.exe
*.ipch
*.sln.ide
*.lock.json
*.db
*.db
.vs/
[Tt]ools/Cake.*
/build/
.dotnet/
DotNetty.*.nuget.targets

23
.vscode/launch.json поставляемый Normal file
Просмотреть файл

@ -0,0 +1,23 @@
{
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceRoot}/bin/Debug/<target-framework>/<project-name.dll>",
"args": [],
"cwd": "${workspaceRoot}",
"externalConsole": false,
"stopAtEntry": false,
"internalConsoleOptions": "openOnSessionStart"
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processId": "${command.pickProcess}"
}
]
}

16
.vscode/tasks.json поставляемый Normal file
Просмотреть файл

@ -0,0 +1,16 @@
{
"version": "0.1.0",
"command": "dotnet",
"isShellCommand": true,
"args": [],
"tasks": [
{
"taskName": "build",
"args": [
"**/project.json"
],
"isBuildCommand": true,
"problemMatcher": "$msCompile"
}
]
}

Просмотреть файл

@ -1,19 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>DotNetty</id>
<version>0.1.2-alpha1</version>
<title>DotNetty framework</title>
<authors>Microsoft</authors>
<owners>Microsoft</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>DotNetty is a port of netty framework. It is an asynchronous event-driven network application framework for rapid development of maintainable high performance protocol servers &amp; clients.</description>
<language>en-US</language>
<dependencies>
</dependencies>
<frameworkAssemblies>
<frameworkAssembly assemblyName="System.Core" targetFramework=".NETFramework4.5" />
<frameworkAssembly assemblyName="System" targetFramework=".NETFramework4.5" />
</frameworkAssemblies>
</metadata>
</package>

Просмотреть файл

@ -3,37 +3,15 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNetty.Common", "src\DotNetty.Common\DotNetty.Common.csproj", "{DE58FE41-5E99-44E5-86BC-FC9ED8761DAF}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{F02D7F30-ABA7-4438-8D28-10898E731906}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNetty.Buffers", "src\DotNetty.Buffers\DotNetty.Buffers.csproj", "{5DE3C557-48BF-4CDB-9F47-474D343DD841}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNetty.Transport", "src\DotNetty.Transport\DotNetty.Transport.csproj", "{8218C9EE-0A4A-432F-A12A-B54202F97B05}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNetty.Codecs", "src\DotNetty.Codecs\DotNetty.Codecs.csproj", "{2ABD244E-EF8F-460D-9C30-39116499E6E4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNetty.Codecs.Mqtt", "src\DotNetty.Codecs.Mqtt\DotNetty.Codecs.Mqtt.csproj", "{58FFEA83-C956-49F9-9435-18332AD0E0D1}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{6A0821D4-8A5D-42AD-8E3F-F519100F4AD8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNetty.Common.Tests", "test\DotNetty.Common.Tests\DotNetty.Common.Tests.csproj", "{B509D8B8-BD4A-46B1-916B-685DE387D01B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNetty.Handlers", "src\DotNetty.Handlers\DotNetty.Handlers.csproj", "{09628314-F44E-445E-9F0D-CBE33B736AC3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNetty.Tests.End2End", "test\DotNetty.Tests.End2End\DotNetty.Tests.End2End.csproj", "{6E76FCAF-C7C8-4F45-8C95-0FD42F2AC83B}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "shared", "shared", "{D7797B37-D5F1-42BD-B59B-61D6A9E5BB33}"
ProjectSection(SolutionItems) = preProject
shared\dotnetty.com.pfx = shared\dotnetty.com.pfx
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNetty.Buffers.Tests", "test\DotNetty.Buffers.Tests\DotNetty.Buffers.Tests.csproj", "{94E10283-E26E-441A-A2A7-D9671A6E9818}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNetty.Codecs.Tests", "test\DotNetty.Codecs.Tests\DotNetty.Codecs.Tests.csproj", "{F9566A9E-FABB-4A57-BF20-C1842AB87012}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNetty.Codecs.Mqtt.Tests", "test\DotNetty.Codecs.Mqtt.Tests\DotNetty.Codecs.Mqtt.Tests.csproj", "{F6019665-4C5E-4769-911A-FA1E83549BF5}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{3263F4AA-4422-4C41-89FC-1A07976FCF94}"
ProjectSection(SolutionItems) = preProject
build.cmd = build.cmd
@ -43,263 +21,246 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{3263F4AA
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "examples", "examples", "{2B766264-D269-415C-8F2A-5AFC44409C01}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNetty.Transport.Tests", "test\DotNetty.Transport.Tests\DotNetty.Transport.Tests.csproj", "{1BC30CEA-312E-41ED-A338-75FBC01C8C91}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{A328D992-54A1-4611-834A-CDA13176371F}"
ProjectSection(SolutionItems) = preProject
global.json = global.json
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Echo", "Echo", "{2F51997C-2026-47CC-A4F8-7560BEC4D918}"
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "DotNetty.Common", "src\DotNetty.Common\DotNetty.Common.xproj", "{C2AEE3C8-EB40-4605-83E1-6D3C1F660B36}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Echo.Client", "examples\Echo.Client\Echo.Client.csproj", "{C24AB93F-41E9-4291-BA8F-E9D3CF6C2EBC}"
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "DotNetty.Buffers", "src\DotNetty.Buffers\DotNetty.Buffers.xproj", "{9E8C428E-1979-457E-8BAF-58228D02F587}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Echo.Server", "examples\Echo.Server\Echo.Server.csproj", "{BA163586-F875-4488-9188-53A4A14DFD34}"
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "DotNetty.Transport", "src\DotNetty.Transport\DotNetty.Transport.xproj", "{EB59C435-1C34-46E4-8F39-BC76ED3AAD05}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNetty.Microbench", "test\DotNetty.Microbench\DotNetty.Microbench.csproj", "{D0D45DCD-EF82-43FA-8B95-D85D50378806}"
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "DotNetty.Codecs", "src\DotNetty.Codecs\DotNetty.Codecs.xproj", "{110520DD-436B-4D17-A99B-5E8AB53B5DC9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNetty.Tests.Common", "test\DotNetty.Tests.Common\DotNetty.Tests.Common.csproj", "{EDF30087-8B53-4432-84B8-D21BD9F49E95}"
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "DotNetty.Codecs.Mqtt", "src\DotNetty.Codecs.Mqtt\DotNetty.Codecs.Mqtt.xproj", "{74943329-1E1F-4651-A56B-2CB6D309E8CB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNetty.Transport.Tests.Performance", "test\DotNetty.Transport.Tests.Performance\DotNetty.Transport.Tests.Performance.csproj", "{F2C39894-476D-441D-878F-23A03B848E06}"
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "DotNetty.Handlers", "src\DotNetty.Handlers\DotNetty.Handlers.xproj", "{F50FF206-E3DB-452D-A93E-883E05D7A873}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNetty.Handlers.Tests", "test\DotNetty.Handlers.Tests\DotNetty.Handlers.Tests.csproj", "{0F5AC479-520B-476F-8E2B-1849F5B63A91}"
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "DotNetty.Tests.Common", "test\DotNetty.Tests.Common\DotNetty.Tests.Common.xproj", "{EDF30087-8B53-4432-84B8-D21BD9F49E95}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Factorial", "Factorial", "{AD047ADA-2282-4626-BE51-5B978BC00B03}"
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "DotNetty.Common.Tests", "test\DotNetty.Common.Tests\DotNetty.Common.Tests.xproj", "{B509D8B8-BD4A-46B1-916B-685DE387D01B}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Discard", "Discard", "{9C0335DC-7DD0-4D0B-AB26-91F9D1EF9BB4}"
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "DotNetty.Buffers.Tests", "test\DotNetty.Buffers.Tests\DotNetty.Buffers.Tests.xproj", "{94E10283-E26E-441A-A2A7-D9671A6E9818}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Factorial", "examples\Factorial\Factorial.csproj", "{C7559BFC-023F-445E-BAB8-E2B5E199B774}"
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "DotNetty.Transport.Tests", "test\DotNetty.Transport.Tests\DotNetty.Transport.Tests.xproj", "{1BC30CEA-312E-41ED-A338-75FBC01C8C91}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Discard.Client", "examples\Discard.Client\Discard.Client.csproj", "{124620F1-A3B6-4B8D-9954-61BF2021DF39}"
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "DotNetty.Codecs.Tests", "test\DotNetty.Codecs.Tests\DotNetty.Codecs.Tests.xproj", "{F9566A9E-FABB-4A57-BF20-C1842AB87012}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Discard.Server", "examples\Discard.Server\Discard.Server.csproj", "{821D5A3F-F4CD-4579-A0A0-95F6770F1DC4}"
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "DotNetty.Codecs.Mqtt.Tests", "test\DotNetty.Codecs.Mqtt.Tests\DotNetty.Codecs.Mqtt.Tests.xproj", "{F6019665-4C5E-4769-911A-FA1E83549BF5}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Factorial.Server", "examples\Factorial.Server\Factorial.Server.csproj", "{CAA57BA8-D7F2-467E-8F6F-5BA5B55A2F0B}"
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "DotNetty.Handlers.Tests", "test\DotNetty.Handlers.Tests\DotNetty.Handlers.Tests.xproj", "{0F5AC479-520B-476F-8E2B-1849F5B63A91}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Factorial.Client", "examples\Factorial.Client\Factorial.Client.csproj", "{E7B7F314-6E72-4CE1-B69C-F5732DCF07F2}"
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "DotNetty.Tests.End2End", "test\DotNetty.Tests.End2End\DotNetty.Tests.End2End.xproj", "{6E76FCAF-C7C8-4F45-8C95-0FD42F2AC83B}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Telnet", "Telnet", "{74506CCF-00FF-40CD-B892-2A6A3FF5CEA6}"
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "DotNetty.Codecs.Redis", "src\DotNetty.Codecs.Redis\DotNetty.Codecs.Redis.xproj", "{6AE7CF76-971C-428B-853A-DBE73A861E60}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Telnet.Client", "examples\Telnet.Client\Telnet.Client.csproj", "{ABABFE48-551E-4C4B-8640-B334329D5C5D}"
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "DotNetty.Codecs.Redis.Tests", "test\DotNetty.Codecs.Redis.Tests\DotNetty.Codecs.Redis.Tests.xproj", "{258ABFFC-4AF5-4CCA-9145-929AC854D139}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Telnet.Server", "examples\Telnet.Server\Telnet.Server.csproj", "{5543847A-8509-4646-8472-1E4450025FDF}"
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "DotNetty.Transport.Tests.Performance", "test\DotNetty.Transport.Tests.Performance\DotNetty.Transport.Tests.Performance.xproj", "{F2C39894-476D-441D-878F-23A03B848E06}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SecureChat", "SecureChat", "{C98D8C38-759D-492E-B5E5-B4BBA65A6AC5}"
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "DotNetty.Microbench", "test\DotNetty.Microbench\DotNetty.Microbench.xproj", "{D0D45DCD-EF82-43FA-8B95-D85D50378806}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SecureChat.Client", "examples\SecureChat.Client\SecureChat.Client.csproj", "{B6C42665-2A5B-4BFD-B5B9-965C31A383D3}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Discard", "Discard", "{B833B237-9230-412F-BBFB-A1094B3B572C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SecureChat.Server", "examples\SecureChat.Server\SecureChat.Server.csproj", "{DDA47BCE-752F-4DEE-BB75-28E7D6921E79}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Echo", "Echo", "{101381DE-CE28-4021-91A9-0461286E093F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNetty.Codecs.Redis", "src\DotNetty.Codecs.Redis\DotNetty.Codecs.Redis.csproj", "{6AE7CF76-971C-428B-853A-DBE73A861E60}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Telnet", "Telnet", "{D2EDC657-B73C-4F20-BBEB-5A3B176072DE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNetty.Codecs.Redis.Tests", "test\DotNetty.Codecs.Redis.Tests\DotNetty.Codecs.Redis.Tests.csproj", "{258ABFFC-4AF5-4CCA-9145-929AC854D139}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Factorial", "Factorial", "{BEFD6C13-AB81-41AD-A887-4F2457751AA6}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Discard.Client", "examples\Discard.Client\Discard.Client.xproj", "{6109C1DB-327D-439B-A0C0-6DD63F1D3DEA}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Discard.Server", "examples\Discard.Server\Discard.Server.xproj", "{821D5A3F-F4CD-4579-A0A0-95F6770F1DC4}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Examples.Common", "examples\Examples.Common\Examples.Common.xproj", "{FC7F860D-BBC8-42E5-B045-F8D98A8A2FD2}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Echo.Client", "examples\Echo.Client\Echo.Client.xproj", "{C24AB93F-41E9-4291-BA8F-E9D3CF6C2EBC}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Echo.Server", "examples\Echo.Server\Echo.Server.xproj", "{BA163586-F875-4488-9188-53A4A14DFD34}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SecureChat", "SecureChat", "{1F198DCE-5712-43F0-986A-13A2041C2657}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Factorial", "examples\Factorial\Factorial.xproj", "{C7559BFC-023F-445E-BAB8-E2B5E199B774}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Factorial.Client", "examples\Factorial.Client\Factorial.Client.xproj", "{E7B7F314-6E72-4CE1-B69C-F5732DCF07F2}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Factorial.Server", "examples\Factorial.Server\Factorial.Server.xproj", "{CAA57BA8-D7F2-467E-8F6F-5BA5B55A2F0B}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "SecureChat.Client", "examples\SecureChat.Client\SecureChat.Client.xproj", "{B6C42665-2A5B-4BFD-B5B9-965C31A383D3}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "SecureChat.Server", "examples\SecureChat.Server\SecureChat.Server.xproj", "{DDA47BCE-752F-4DEE-BB75-28E7D6921E79}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Telnet.Client", "examples\Telnet.Client\Telnet.Client.xproj", "{ABABFE48-551E-4C4B-8640-B334329D5C5D}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Telnet.Server", "examples\Telnet.Server\Telnet.Server.xproj", "{5543847A-8509-4646-8472-1E4450025FDF}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
Signed|Any CPU = Signed|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{DE58FE41-5E99-44E5-86BC-FC9ED8761DAF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DE58FE41-5E99-44E5-86BC-FC9ED8761DAF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DE58FE41-5E99-44E5-86BC-FC9ED8761DAF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DE58FE41-5E99-44E5-86BC-FC9ED8761DAF}.Release|Any CPU.Build.0 = Release|Any CPU
{DE58FE41-5E99-44E5-86BC-FC9ED8761DAF}.Signed|Any CPU.ActiveCfg = Signed|Any CPU
{DE58FE41-5E99-44E5-86BC-FC9ED8761DAF}.Signed|Any CPU.Build.0 = Signed|Any CPU
{5DE3C557-48BF-4CDB-9F47-474D343DD841}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5DE3C557-48BF-4CDB-9F47-474D343DD841}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5DE3C557-48BF-4CDB-9F47-474D343DD841}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5DE3C557-48BF-4CDB-9F47-474D343DD841}.Release|Any CPU.Build.0 = Release|Any CPU
{5DE3C557-48BF-4CDB-9F47-474D343DD841}.Signed|Any CPU.ActiveCfg = Signed|Any CPU
{5DE3C557-48BF-4CDB-9F47-474D343DD841}.Signed|Any CPU.Build.0 = Signed|Any CPU
{8218C9EE-0A4A-432F-A12A-B54202F97B05}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8218C9EE-0A4A-432F-A12A-B54202F97B05}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8218C9EE-0A4A-432F-A12A-B54202F97B05}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8218C9EE-0A4A-432F-A12A-B54202F97B05}.Release|Any CPU.Build.0 = Release|Any CPU
{8218C9EE-0A4A-432F-A12A-B54202F97B05}.Signed|Any CPU.ActiveCfg = Signed|Any CPU
{8218C9EE-0A4A-432F-A12A-B54202F97B05}.Signed|Any CPU.Build.0 = Signed|Any CPU
{2ABD244E-EF8F-460D-9C30-39116499E6E4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2ABD244E-EF8F-460D-9C30-39116499E6E4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2ABD244E-EF8F-460D-9C30-39116499E6E4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2ABD244E-EF8F-460D-9C30-39116499E6E4}.Release|Any CPU.Build.0 = Release|Any CPU
{2ABD244E-EF8F-460D-9C30-39116499E6E4}.Signed|Any CPU.ActiveCfg = Release|Any CPU
{2ABD244E-EF8F-460D-9C30-39116499E6E4}.Signed|Any CPU.Build.0 = Release|Any CPU
{58FFEA83-C956-49F9-9435-18332AD0E0D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{58FFEA83-C956-49F9-9435-18332AD0E0D1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{58FFEA83-C956-49F9-9435-18332AD0E0D1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{58FFEA83-C956-49F9-9435-18332AD0E0D1}.Release|Any CPU.Build.0 = Release|Any CPU
{58FFEA83-C956-49F9-9435-18332AD0E0D1}.Signed|Any CPU.ActiveCfg = Signed|Any CPU
{58FFEA83-C956-49F9-9435-18332AD0E0D1}.Signed|Any CPU.Build.0 = Signed|Any CPU
{B509D8B8-BD4A-46B1-916B-685DE387D01B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B509D8B8-BD4A-46B1-916B-685DE387D01B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B509D8B8-BD4A-46B1-916B-685DE387D01B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B509D8B8-BD4A-46B1-916B-685DE387D01B}.Release|Any CPU.Build.0 = Release|Any CPU
{B509D8B8-BD4A-46B1-916B-685DE387D01B}.Signed|Any CPU.ActiveCfg = Release|Any CPU
{09628314-F44E-445E-9F0D-CBE33B736AC3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{09628314-F44E-445E-9F0D-CBE33B736AC3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{09628314-F44E-445E-9F0D-CBE33B736AC3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{09628314-F44E-445E-9F0D-CBE33B736AC3}.Release|Any CPU.Build.0 = Release|Any CPU
{09628314-F44E-445E-9F0D-CBE33B736AC3}.Signed|Any CPU.ActiveCfg = Release|Any CPU
{09628314-F44E-445E-9F0D-CBE33B736AC3}.Signed|Any CPU.Build.0 = Release|Any CPU
{6E76FCAF-C7C8-4F45-8C95-0FD42F2AC83B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6E76FCAF-C7C8-4F45-8C95-0FD42F2AC83B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6E76FCAF-C7C8-4F45-8C95-0FD42F2AC83B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6E76FCAF-C7C8-4F45-8C95-0FD42F2AC83B}.Release|Any CPU.Build.0 = Release|Any CPU
{6E76FCAF-C7C8-4F45-8C95-0FD42F2AC83B}.Signed|Any CPU.ActiveCfg = Release|Any CPU
{6E76FCAF-C7C8-4F45-8C95-0FD42F2AC83B}.Signed|Any CPU.Build.0 = Release|Any CPU
{94E10283-E26E-441A-A2A7-D9671A6E9818}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{94E10283-E26E-441A-A2A7-D9671A6E9818}.Debug|Any CPU.Build.0 = Debug|Any CPU
{94E10283-E26E-441A-A2A7-D9671A6E9818}.Release|Any CPU.ActiveCfg = Release|Any CPU
{94E10283-E26E-441A-A2A7-D9671A6E9818}.Release|Any CPU.Build.0 = Release|Any CPU
{94E10283-E26E-441A-A2A7-D9671A6E9818}.Signed|Any CPU.ActiveCfg = Release|Any CPU
{F9566A9E-FABB-4A57-BF20-C1842AB87012}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F9566A9E-FABB-4A57-BF20-C1842AB87012}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F9566A9E-FABB-4A57-BF20-C1842AB87012}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F9566A9E-FABB-4A57-BF20-C1842AB87012}.Release|Any CPU.Build.0 = Release|Any CPU
{F9566A9E-FABB-4A57-BF20-C1842AB87012}.Signed|Any CPU.ActiveCfg = Release|Any CPU
{F6019665-4C5E-4769-911A-FA1E83549BF5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F6019665-4C5E-4769-911A-FA1E83549BF5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F6019665-4C5E-4769-911A-FA1E83549BF5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F6019665-4C5E-4769-911A-FA1E83549BF5}.Release|Any CPU.Build.0 = Release|Any CPU
{F6019665-4C5E-4769-911A-FA1E83549BF5}.Signed|Any CPU.ActiveCfg = Release|Any CPU
{1BC30CEA-312E-41ED-A338-75FBC01C8C91}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1BC30CEA-312E-41ED-A338-75FBC01C8C91}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1BC30CEA-312E-41ED-A338-75FBC01C8C91}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1BC30CEA-312E-41ED-A338-75FBC01C8C91}.Release|Any CPU.Build.0 = Release|Any CPU
{1BC30CEA-312E-41ED-A338-75FBC01C8C91}.Signed|Any CPU.ActiveCfg = Release|Any CPU
{C24AB93F-41E9-4291-BA8F-E9D3CF6C2EBC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C24AB93F-41E9-4291-BA8F-E9D3CF6C2EBC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C24AB93F-41E9-4291-BA8F-E9D3CF6C2EBC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C24AB93F-41E9-4291-BA8F-E9D3CF6C2EBC}.Release|Any CPU.Build.0 = Release|Any CPU
{C24AB93F-41E9-4291-BA8F-E9D3CF6C2EBC}.Signed|Any CPU.ActiveCfg = Release|Any CPU
{BA163586-F875-4488-9188-53A4A14DFD34}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BA163586-F875-4488-9188-53A4A14DFD34}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BA163586-F875-4488-9188-53A4A14DFD34}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BA163586-F875-4488-9188-53A4A14DFD34}.Release|Any CPU.Build.0 = Release|Any CPU
{BA163586-F875-4488-9188-53A4A14DFD34}.Signed|Any CPU.ActiveCfg = Release|Any CPU
{D0D45DCD-EF82-43FA-8B95-D85D50378806}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D0D45DCD-EF82-43FA-8B95-D85D50378806}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D0D45DCD-EF82-43FA-8B95-D85D50378806}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D0D45DCD-EF82-43FA-8B95-D85D50378806}.Release|Any CPU.Build.0 = Release|Any CPU
{D0D45DCD-EF82-43FA-8B95-D85D50378806}.Signed|Any CPU.ActiveCfg = Release|Any CPU
{C2AEE3C8-EB40-4605-83E1-6D3C1F660B36}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C2AEE3C8-EB40-4605-83E1-6D3C1F660B36}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C2AEE3C8-EB40-4605-83E1-6D3C1F660B36}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C2AEE3C8-EB40-4605-83E1-6D3C1F660B36}.Release|Any CPU.Build.0 = Release|Any CPU
{9E8C428E-1979-457E-8BAF-58228D02F587}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9E8C428E-1979-457E-8BAF-58228D02F587}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9E8C428E-1979-457E-8BAF-58228D02F587}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9E8C428E-1979-457E-8BAF-58228D02F587}.Release|Any CPU.Build.0 = Release|Any CPU
{EB59C435-1C34-46E4-8F39-BC76ED3AAD05}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EB59C435-1C34-46E4-8F39-BC76ED3AAD05}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EB59C435-1C34-46E4-8F39-BC76ED3AAD05}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EB59C435-1C34-46E4-8F39-BC76ED3AAD05}.Release|Any CPU.Build.0 = Release|Any CPU
{110520DD-436B-4D17-A99B-5E8AB53B5DC9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{110520DD-436B-4D17-A99B-5E8AB53B5DC9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{110520DD-436B-4D17-A99B-5E8AB53B5DC9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{110520DD-436B-4D17-A99B-5E8AB53B5DC9}.Release|Any CPU.Build.0 = Release|Any CPU
{74943329-1E1F-4651-A56B-2CB6D309E8CB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{74943329-1E1F-4651-A56B-2CB6D309E8CB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{74943329-1E1F-4651-A56B-2CB6D309E8CB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{74943329-1E1F-4651-A56B-2CB6D309E8CB}.Release|Any CPU.Build.0 = Release|Any CPU
{F50FF206-E3DB-452D-A93E-883E05D7A873}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F50FF206-E3DB-452D-A93E-883E05D7A873}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F50FF206-E3DB-452D-A93E-883E05D7A873}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F50FF206-E3DB-452D-A93E-883E05D7A873}.Release|Any CPU.Build.0 = Release|Any CPU
{EDF30087-8B53-4432-84B8-D21BD9F49E95}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EDF30087-8B53-4432-84B8-D21BD9F49E95}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EDF30087-8B53-4432-84B8-D21BD9F49E95}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EDF30087-8B53-4432-84B8-D21BD9F49E95}.Release|Any CPU.Build.0 = Release|Any CPU
{EDF30087-8B53-4432-84B8-D21BD9F49E95}.Signed|Any CPU.ActiveCfg = Release|Any CPU
{EDF30087-8B53-4432-84B8-D21BD9F49E95}.Signed|Any CPU.Build.0 = Release|Any CPU
{F2C39894-476D-441D-878F-23A03B848E06}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F2C39894-476D-441D-878F-23A03B848E06}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F2C39894-476D-441D-878F-23A03B848E06}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F2C39894-476D-441D-878F-23A03B848E06}.Release|Any CPU.Build.0 = Release|Any CPU
{F2C39894-476D-441D-878F-23A03B848E06}.Signed|Any CPU.ActiveCfg = Release|Any CPU
{F2C39894-476D-441D-878F-23A03B848E06}.Signed|Any CPU.Build.0 = Release|Any CPU
{B509D8B8-BD4A-46B1-916B-685DE387D01B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B509D8B8-BD4A-46B1-916B-685DE387D01B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B509D8B8-BD4A-46B1-916B-685DE387D01B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B509D8B8-BD4A-46B1-916B-685DE387D01B}.Release|Any CPU.Build.0 = Release|Any CPU
{94E10283-E26E-441A-A2A7-D9671A6E9818}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{94E10283-E26E-441A-A2A7-D9671A6E9818}.Debug|Any CPU.Build.0 = Debug|Any CPU
{94E10283-E26E-441A-A2A7-D9671A6E9818}.Release|Any CPU.ActiveCfg = Release|Any CPU
{94E10283-E26E-441A-A2A7-D9671A6E9818}.Release|Any CPU.Build.0 = Release|Any CPU
{1BC30CEA-312E-41ED-A338-75FBC01C8C91}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1BC30CEA-312E-41ED-A338-75FBC01C8C91}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1BC30CEA-312E-41ED-A338-75FBC01C8C91}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1BC30CEA-312E-41ED-A338-75FBC01C8C91}.Release|Any CPU.Build.0 = Release|Any CPU
{F9566A9E-FABB-4A57-BF20-C1842AB87012}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F9566A9E-FABB-4A57-BF20-C1842AB87012}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F9566A9E-FABB-4A57-BF20-C1842AB87012}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F9566A9E-FABB-4A57-BF20-C1842AB87012}.Release|Any CPU.Build.0 = Release|Any CPU
{F6019665-4C5E-4769-911A-FA1E83549BF5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F6019665-4C5E-4769-911A-FA1E83549BF5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F6019665-4C5E-4769-911A-FA1E83549BF5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F6019665-4C5E-4769-911A-FA1E83549BF5}.Release|Any CPU.Build.0 = Release|Any CPU
{0F5AC479-520B-476F-8E2B-1849F5B63A91}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0F5AC479-520B-476F-8E2B-1849F5B63A91}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0F5AC479-520B-476F-8E2B-1849F5B63A91}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0F5AC479-520B-476F-8E2B-1849F5B63A91}.Release|Any CPU.Build.0 = Release|Any CPU
{0F5AC479-520B-476F-8E2B-1849F5B63A91}.Signed|Any CPU.ActiveCfg = Release|Any CPU
{0F5AC479-520B-476F-8E2B-1849F5B63A91}.Signed|Any CPU.Build.0 = Release|Any CPU
{C7559BFC-023F-445E-BAB8-E2B5E199B774}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C7559BFC-023F-445E-BAB8-E2B5E199B774}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C7559BFC-023F-445E-BAB8-E2B5E199B774}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C7559BFC-023F-445E-BAB8-E2B5E199B774}.Release|Any CPU.Build.0 = Release|Any CPU
{C7559BFC-023F-445E-BAB8-E2B5E199B774}.Signed|Any CPU.ActiveCfg = Release|Any CPU
{C7559BFC-023F-445E-BAB8-E2B5E199B774}.Signed|Any CPU.Build.0 = Release|Any CPU
{124620F1-A3B6-4B8D-9954-61BF2021DF39}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{124620F1-A3B6-4B8D-9954-61BF2021DF39}.Debug|Any CPU.Build.0 = Debug|Any CPU
{124620F1-A3B6-4B8D-9954-61BF2021DF39}.Release|Any CPU.ActiveCfg = Release|Any CPU
{124620F1-A3B6-4B8D-9954-61BF2021DF39}.Release|Any CPU.Build.0 = Release|Any CPU
{124620F1-A3B6-4B8D-9954-61BF2021DF39}.Signed|Any CPU.ActiveCfg = Release|Any CPU
{124620F1-A3B6-4B8D-9954-61BF2021DF39}.Signed|Any CPU.Build.0 = Release|Any CPU
{821D5A3F-F4CD-4579-A0A0-95F6770F1DC4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{821D5A3F-F4CD-4579-A0A0-95F6770F1DC4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{821D5A3F-F4CD-4579-A0A0-95F6770F1DC4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{821D5A3F-F4CD-4579-A0A0-95F6770F1DC4}.Release|Any CPU.Build.0 = Release|Any CPU
{821D5A3F-F4CD-4579-A0A0-95F6770F1DC4}.Signed|Any CPU.ActiveCfg = Release|Any CPU
{821D5A3F-F4CD-4579-A0A0-95F6770F1DC4}.Signed|Any CPU.Build.0 = Release|Any CPU
{CAA57BA8-D7F2-467E-8F6F-5BA5B55A2F0B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CAA57BA8-D7F2-467E-8F6F-5BA5B55A2F0B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CAA57BA8-D7F2-467E-8F6F-5BA5B55A2F0B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CAA57BA8-D7F2-467E-8F6F-5BA5B55A2F0B}.Release|Any CPU.Build.0 = Release|Any CPU
{CAA57BA8-D7F2-467E-8F6F-5BA5B55A2F0B}.Signed|Any CPU.ActiveCfg = Release|Any CPU
{CAA57BA8-D7F2-467E-8F6F-5BA5B55A2F0B}.Signed|Any CPU.Build.0 = Release|Any CPU
{E7B7F314-6E72-4CE1-B69C-F5732DCF07F2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E7B7F314-6E72-4CE1-B69C-F5732DCF07F2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E7B7F314-6E72-4CE1-B69C-F5732DCF07F2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E7B7F314-6E72-4CE1-B69C-F5732DCF07F2}.Release|Any CPU.Build.0 = Release|Any CPU
{E7B7F314-6E72-4CE1-B69C-F5732DCF07F2}.Signed|Any CPU.ActiveCfg = Release|Any CPU
{E7B7F314-6E72-4CE1-B69C-F5732DCF07F2}.Signed|Any CPU.Build.0 = Release|Any CPU
{ABABFE48-551E-4C4B-8640-B334329D5C5D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ABABFE48-551E-4C4B-8640-B334329D5C5D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ABABFE48-551E-4C4B-8640-B334329D5C5D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ABABFE48-551E-4C4B-8640-B334329D5C5D}.Release|Any CPU.Build.0 = Release|Any CPU
{ABABFE48-551E-4C4B-8640-B334329D5C5D}.Signed|Any CPU.ActiveCfg = Release|Any CPU
{ABABFE48-551E-4C4B-8640-B334329D5C5D}.Signed|Any CPU.Build.0 = Release|Any CPU
{5543847A-8509-4646-8472-1E4450025FDF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5543847A-8509-4646-8472-1E4450025FDF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5543847A-8509-4646-8472-1E4450025FDF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5543847A-8509-4646-8472-1E4450025FDF}.Release|Any CPU.Build.0 = Release|Any CPU
{5543847A-8509-4646-8472-1E4450025FDF}.Signed|Any CPU.ActiveCfg = Release|Any CPU
{5543847A-8509-4646-8472-1E4450025FDF}.Signed|Any CPU.Build.0 = Release|Any CPU
{B6C42665-2A5B-4BFD-B5B9-965C31A383D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B6C42665-2A5B-4BFD-B5B9-965C31A383D3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B6C42665-2A5B-4BFD-B5B9-965C31A383D3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B6C42665-2A5B-4BFD-B5B9-965C31A383D3}.Release|Any CPU.Build.0 = Release|Any CPU
{B6C42665-2A5B-4BFD-B5B9-965C31A383D3}.Signed|Any CPU.ActiveCfg = Release|Any CPU
{B6C42665-2A5B-4BFD-B5B9-965C31A383D3}.Signed|Any CPU.Build.0 = Release|Any CPU
{DDA47BCE-752F-4DEE-BB75-28E7D6921E79}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DDA47BCE-752F-4DEE-BB75-28E7D6921E79}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DDA47BCE-752F-4DEE-BB75-28E7D6921E79}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DDA47BCE-752F-4DEE-BB75-28E7D6921E79}.Release|Any CPU.Build.0 = Release|Any CPU
{DDA47BCE-752F-4DEE-BB75-28E7D6921E79}.Signed|Any CPU.ActiveCfg = Release|Any CPU
{DDA47BCE-752F-4DEE-BB75-28E7D6921E79}.Signed|Any CPU.Build.0 = Release|Any CPU
{6E76FCAF-C7C8-4F45-8C95-0FD42F2AC83B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6E76FCAF-C7C8-4F45-8C95-0FD42F2AC83B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6E76FCAF-C7C8-4F45-8C95-0FD42F2AC83B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6E76FCAF-C7C8-4F45-8C95-0FD42F2AC83B}.Release|Any CPU.Build.0 = Release|Any CPU
{6AE7CF76-971C-428B-853A-DBE73A861E60}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6AE7CF76-971C-428B-853A-DBE73A861E60}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6AE7CF76-971C-428B-853A-DBE73A861E60}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6AE7CF76-971C-428B-853A-DBE73A861E60}.Release|Any CPU.Build.0 = Release|Any CPU
{6AE7CF76-971C-428B-853A-DBE73A861E60}.Signed|Any CPU.ActiveCfg = Release|Any CPU
{6AE7CF76-971C-428B-853A-DBE73A861E60}.Signed|Any CPU.Build.0 = Release|Any CPU
{258ABFFC-4AF5-4CCA-9145-929AC854D139}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{258ABFFC-4AF5-4CCA-9145-929AC854D139}.Debug|Any CPU.Build.0 = Debug|Any CPU
{258ABFFC-4AF5-4CCA-9145-929AC854D139}.Release|Any CPU.ActiveCfg = Release|Any CPU
{258ABFFC-4AF5-4CCA-9145-929AC854D139}.Release|Any CPU.Build.0 = Release|Any CPU
{258ABFFC-4AF5-4CCA-9145-929AC854D139}.Signed|Any CPU.ActiveCfg = Release|Any CPU
{258ABFFC-4AF5-4CCA-9145-929AC854D139}.Signed|Any CPU.Build.0 = Release|Any CPU
{F2C39894-476D-441D-878F-23A03B848E06}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F2C39894-476D-441D-878F-23A03B848E06}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F2C39894-476D-441D-878F-23A03B848E06}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F2C39894-476D-441D-878F-23A03B848E06}.Release|Any CPU.Build.0 = Release|Any CPU
{D0D45DCD-EF82-43FA-8B95-D85D50378806}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D0D45DCD-EF82-43FA-8B95-D85D50378806}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D0D45DCD-EF82-43FA-8B95-D85D50378806}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D0D45DCD-EF82-43FA-8B95-D85D50378806}.Release|Any CPU.Build.0 = Release|Any CPU
{6109C1DB-327D-439B-A0C0-6DD63F1D3DEA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6109C1DB-327D-439B-A0C0-6DD63F1D3DEA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6109C1DB-327D-439B-A0C0-6DD63F1D3DEA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6109C1DB-327D-439B-A0C0-6DD63F1D3DEA}.Release|Any CPU.Build.0 = Release|Any CPU
{821D5A3F-F4CD-4579-A0A0-95F6770F1DC4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{821D5A3F-F4CD-4579-A0A0-95F6770F1DC4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{821D5A3F-F4CD-4579-A0A0-95F6770F1DC4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{821D5A3F-F4CD-4579-A0A0-95F6770F1DC4}.Release|Any CPU.Build.0 = Release|Any CPU
{FC7F860D-BBC8-42E5-B045-F8D98A8A2FD2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FC7F860D-BBC8-42E5-B045-F8D98A8A2FD2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FC7F860D-BBC8-42E5-B045-F8D98A8A2FD2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FC7F860D-BBC8-42E5-B045-F8D98A8A2FD2}.Release|Any CPU.Build.0 = Release|Any CPU
{C24AB93F-41E9-4291-BA8F-E9D3CF6C2EBC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C24AB93F-41E9-4291-BA8F-E9D3CF6C2EBC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C24AB93F-41E9-4291-BA8F-E9D3CF6C2EBC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C24AB93F-41E9-4291-BA8F-E9D3CF6C2EBC}.Release|Any CPU.Build.0 = Release|Any CPU
{BA163586-F875-4488-9188-53A4A14DFD34}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BA163586-F875-4488-9188-53A4A14DFD34}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BA163586-F875-4488-9188-53A4A14DFD34}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BA163586-F875-4488-9188-53A4A14DFD34}.Release|Any CPU.Build.0 = Release|Any CPU
{C7559BFC-023F-445E-BAB8-E2B5E199B774}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C7559BFC-023F-445E-BAB8-E2B5E199B774}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C7559BFC-023F-445E-BAB8-E2B5E199B774}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C7559BFC-023F-445E-BAB8-E2B5E199B774}.Release|Any CPU.Build.0 = Release|Any CPU
{E7B7F314-6E72-4CE1-B69C-F5732DCF07F2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E7B7F314-6E72-4CE1-B69C-F5732DCF07F2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E7B7F314-6E72-4CE1-B69C-F5732DCF07F2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E7B7F314-6E72-4CE1-B69C-F5732DCF07F2}.Release|Any CPU.Build.0 = Release|Any CPU
{CAA57BA8-D7F2-467E-8F6F-5BA5B55A2F0B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CAA57BA8-D7F2-467E-8F6F-5BA5B55A2F0B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CAA57BA8-D7F2-467E-8F6F-5BA5B55A2F0B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CAA57BA8-D7F2-467E-8F6F-5BA5B55A2F0B}.Release|Any CPU.Build.0 = Release|Any CPU
{B6C42665-2A5B-4BFD-B5B9-965C31A383D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B6C42665-2A5B-4BFD-B5B9-965C31A383D3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B6C42665-2A5B-4BFD-B5B9-965C31A383D3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B6C42665-2A5B-4BFD-B5B9-965C31A383D3}.Release|Any CPU.Build.0 = Release|Any CPU
{DDA47BCE-752F-4DEE-BB75-28E7D6921E79}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DDA47BCE-752F-4DEE-BB75-28E7D6921E79}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DDA47BCE-752F-4DEE-BB75-28E7D6921E79}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DDA47BCE-752F-4DEE-BB75-28E7D6921E79}.Release|Any CPU.Build.0 = Release|Any CPU
{ABABFE48-551E-4C4B-8640-B334329D5C5D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ABABFE48-551E-4C4B-8640-B334329D5C5D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ABABFE48-551E-4C4B-8640-B334329D5C5D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ABABFE48-551E-4C4B-8640-B334329D5C5D}.Release|Any CPU.Build.0 = Release|Any CPU
{5543847A-8509-4646-8472-1E4450025FDF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5543847A-8509-4646-8472-1E4450025FDF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5543847A-8509-4646-8472-1E4450025FDF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5543847A-8509-4646-8472-1E4450025FDF}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{DE58FE41-5E99-44E5-86BC-FC9ED8761DAF} = {F02D7F30-ABA7-4438-8D28-10898E731906}
{5DE3C557-48BF-4CDB-9F47-474D343DD841} = {F02D7F30-ABA7-4438-8D28-10898E731906}
{8218C9EE-0A4A-432F-A12A-B54202F97B05} = {F02D7F30-ABA7-4438-8D28-10898E731906}
{2ABD244E-EF8F-460D-9C30-39116499E6E4} = {F02D7F30-ABA7-4438-8D28-10898E731906}
{58FFEA83-C956-49F9-9435-18332AD0E0D1} = {F02D7F30-ABA7-4438-8D28-10898E731906}
{C2AEE3C8-EB40-4605-83E1-6D3C1F660B36} = {F02D7F30-ABA7-4438-8D28-10898E731906}
{9E8C428E-1979-457E-8BAF-58228D02F587} = {F02D7F30-ABA7-4438-8D28-10898E731906}
{EB59C435-1C34-46E4-8F39-BC76ED3AAD05} = {F02D7F30-ABA7-4438-8D28-10898E731906}
{110520DD-436B-4D17-A99B-5E8AB53B5DC9} = {F02D7F30-ABA7-4438-8D28-10898E731906}
{74943329-1E1F-4651-A56B-2CB6D309E8CB} = {F02D7F30-ABA7-4438-8D28-10898E731906}
{F50FF206-E3DB-452D-A93E-883E05D7A873} = {F02D7F30-ABA7-4438-8D28-10898E731906}
{EDF30087-8B53-4432-84B8-D21BD9F49E95} = {6A0821D4-8A5D-42AD-8E3F-F519100F4AD8}
{B509D8B8-BD4A-46B1-916B-685DE387D01B} = {6A0821D4-8A5D-42AD-8E3F-F519100F4AD8}
{09628314-F44E-445E-9F0D-CBE33B736AC3} = {F02D7F30-ABA7-4438-8D28-10898E731906}
{6E76FCAF-C7C8-4F45-8C95-0FD42F2AC83B} = {6A0821D4-8A5D-42AD-8E3F-F519100F4AD8}
{94E10283-E26E-441A-A2A7-D9671A6E9818} = {6A0821D4-8A5D-42AD-8E3F-F519100F4AD8}
{1BC30CEA-312E-41ED-A338-75FBC01C8C91} = {6A0821D4-8A5D-42AD-8E3F-F519100F4AD8}
{F9566A9E-FABB-4A57-BF20-C1842AB87012} = {6A0821D4-8A5D-42AD-8E3F-F519100F4AD8}
{F6019665-4C5E-4769-911A-FA1E83549BF5} = {6A0821D4-8A5D-42AD-8E3F-F519100F4AD8}
{1BC30CEA-312E-41ED-A338-75FBC01C8C91} = {6A0821D4-8A5D-42AD-8E3F-F519100F4AD8}
{2F51997C-2026-47CC-A4F8-7560BEC4D918} = {2B766264-D269-415C-8F2A-5AFC44409C01}
{C24AB93F-41E9-4291-BA8F-E9D3CF6C2EBC} = {2F51997C-2026-47CC-A4F8-7560BEC4D918}
{BA163586-F875-4488-9188-53A4A14DFD34} = {2F51997C-2026-47CC-A4F8-7560BEC4D918}
{D0D45DCD-EF82-43FA-8B95-D85D50378806} = {6A0821D4-8A5D-42AD-8E3F-F519100F4AD8}
{EDF30087-8B53-4432-84B8-D21BD9F49E95} = {6A0821D4-8A5D-42AD-8E3F-F519100F4AD8}
{F2C39894-476D-441D-878F-23A03B848E06} = {6A0821D4-8A5D-42AD-8E3F-F519100F4AD8}
{0F5AC479-520B-476F-8E2B-1849F5B63A91} = {6A0821D4-8A5D-42AD-8E3F-F519100F4AD8}
{AD047ADA-2282-4626-BE51-5B978BC00B03} = {2B766264-D269-415C-8F2A-5AFC44409C01}
{9C0335DC-7DD0-4D0B-AB26-91F9D1EF9BB4} = {2B766264-D269-415C-8F2A-5AFC44409C01}
{C7559BFC-023F-445E-BAB8-E2B5E199B774} = {AD047ADA-2282-4626-BE51-5B978BC00B03}
{124620F1-A3B6-4B8D-9954-61BF2021DF39} = {9C0335DC-7DD0-4D0B-AB26-91F9D1EF9BB4}
{821D5A3F-F4CD-4579-A0A0-95F6770F1DC4} = {9C0335DC-7DD0-4D0B-AB26-91F9D1EF9BB4}
{CAA57BA8-D7F2-467E-8F6F-5BA5B55A2F0B} = {AD047ADA-2282-4626-BE51-5B978BC00B03}
{E7B7F314-6E72-4CE1-B69C-F5732DCF07F2} = {AD047ADA-2282-4626-BE51-5B978BC00B03}
{74506CCF-00FF-40CD-B892-2A6A3FF5CEA6} = {2B766264-D269-415C-8F2A-5AFC44409C01}
{ABABFE48-551E-4C4B-8640-B334329D5C5D} = {74506CCF-00FF-40CD-B892-2A6A3FF5CEA6}
{5543847A-8509-4646-8472-1E4450025FDF} = {74506CCF-00FF-40CD-B892-2A6A3FF5CEA6}
{C98D8C38-759D-492E-B5E5-B4BBA65A6AC5} = {2B766264-D269-415C-8F2A-5AFC44409C01}
{B6C42665-2A5B-4BFD-B5B9-965C31A383D3} = {C98D8C38-759D-492E-B5E5-B4BBA65A6AC5}
{DDA47BCE-752F-4DEE-BB75-28E7D6921E79} = {C98D8C38-759D-492E-B5E5-B4BBA65A6AC5}
{6E76FCAF-C7C8-4F45-8C95-0FD42F2AC83B} = {6A0821D4-8A5D-42AD-8E3F-F519100F4AD8}
{6AE7CF76-971C-428B-853A-DBE73A861E60} = {F02D7F30-ABA7-4438-8D28-10898E731906}
{258ABFFC-4AF5-4CCA-9145-929AC854D139} = {6A0821D4-8A5D-42AD-8E3F-F519100F4AD8}
{F2C39894-476D-441D-878F-23A03B848E06} = {6A0821D4-8A5D-42AD-8E3F-F519100F4AD8}
{D0D45DCD-EF82-43FA-8B95-D85D50378806} = {6A0821D4-8A5D-42AD-8E3F-F519100F4AD8}
{B833B237-9230-412F-BBFB-A1094B3B572C} = {2B766264-D269-415C-8F2A-5AFC44409C01}
{101381DE-CE28-4021-91A9-0461286E093F} = {2B766264-D269-415C-8F2A-5AFC44409C01}
{D2EDC657-B73C-4F20-BBEB-5A3B176072DE} = {2B766264-D269-415C-8F2A-5AFC44409C01}
{BEFD6C13-AB81-41AD-A887-4F2457751AA6} = {2B766264-D269-415C-8F2A-5AFC44409C01}
{6109C1DB-327D-439B-A0C0-6DD63F1D3DEA} = {B833B237-9230-412F-BBFB-A1094B3B572C}
{821D5A3F-F4CD-4579-A0A0-95F6770F1DC4} = {B833B237-9230-412F-BBFB-A1094B3B572C}
{FC7F860D-BBC8-42E5-B045-F8D98A8A2FD2} = {2B766264-D269-415C-8F2A-5AFC44409C01}
{C24AB93F-41E9-4291-BA8F-E9D3CF6C2EBC} = {101381DE-CE28-4021-91A9-0461286E093F}
{BA163586-F875-4488-9188-53A4A14DFD34} = {101381DE-CE28-4021-91A9-0461286E093F}
{1F198DCE-5712-43F0-986A-13A2041C2657} = {2B766264-D269-415C-8F2A-5AFC44409C01}
{C7559BFC-023F-445E-BAB8-E2B5E199B774} = {BEFD6C13-AB81-41AD-A887-4F2457751AA6}
{E7B7F314-6E72-4CE1-B69C-F5732DCF07F2} = {BEFD6C13-AB81-41AD-A887-4F2457751AA6}
{CAA57BA8-D7F2-467E-8F6F-5BA5B55A2F0B} = {BEFD6C13-AB81-41AD-A887-4F2457751AA6}
{B6C42665-2A5B-4BFD-B5B9-965C31A383D3} = {1F198DCE-5712-43F0-986A-13A2041C2657}
{DDA47BCE-752F-4DEE-BB75-28E7D6921E79} = {1F198DCE-5712-43F0-986A-13A2041C2657}
{ABABFE48-551E-4C4B-8640-B334329D5C5D} = {D2EDC657-B73C-4F20-BBEB-5A3B176072DE}
{5543847A-8509-4646-8472-1E4450025FDF} = {D2EDC657-B73C-4F20-BBEB-5A3B176072DE}
EndGlobalSection
EndGlobal

Двоичные данные
DotNetty.snk Normal file

Двоичный файл не отображается.

Просмотреть файл

@ -1,3 +1,8 @@
#### 0.3.3 November 04 2016
- .NET Standard 1.3 support.
- Libraries are strong-named by default.
- Redis codec.
#### 0.3.2 June 22 2016
- Better API alignment with final version of netty 4.1 (#125).
- Exposed API for flexible TlsHandler initialization (#132, #134).

328
build.cake Normal file
Просмотреть файл

@ -0,0 +1,328 @@
// Usings
using System.Xml;
using System.Xml.Linq;
using System.Xml.XPath;
// Arguments
var target = Argument<string>("target", "Default");
var source = Argument<string>("source", null);
var apiKey = Argument<string>("apikey", null);
var releaseNote = ParseReleaseNotes("./RELEASE_NOTES.md");
var buildNumber = EnvironmentVariable("BUILD_NUMBER") ?? "0";
var version = Argument<string>("targetversion", $"{releaseNote.Version}.{buildNumber}-beta");
var skipClean = Argument<bool>("skipclean", false);
var skipTests = Argument<bool>("skiptests", false);
var nogit = Argument<bool>("nogit", false);
// Variables
var configuration = IsRunningOnWindows() ? "Release" : "MonoRelease";
var projectJsonFiles = GetFiles("./src/**/project.json");
// Directories
var nuget = Directory(".nuget");
var output = Directory("build");
var outputBinaries = output + Directory("binaries");
var outputBinariesNet451 = outputBinaries + Directory("net451");
var outputBinariesNetstandard = outputBinaries + Directory("netstandard1.3");
var outputPackages = output + Directory("packages");
var outputNuGet = output + Directory("nuget");
var outputPerfResults = Directory("perfResults");
///////////////////////////////////////////////////////////////
Task("Clean")
.Does(() =>
{
// Clean artifact directories.
CleanDirectories(new DirectoryPath[] {
output, outputBinaries, outputPackages, outputNuGet,
outputBinariesNet451, outputBinariesNetstandard
});
if(!skipClean) {
// Clean output directories.
CleanDirectories("./**/bin/" + configuration);
CleanDirectories("./**/obj/" + configuration);
}
});
Task("Restore-NuGet-Packages")
.Description("Restores dependencies")
.Does(() =>
{
var settings = new DotNetCoreRestoreSettings
{
Verbose = false,
Verbosity = DotNetCoreRestoreVerbosity.Warning
};
DotNetCoreRestore("./", settings);
});
Task("Compile")
.Description("Builds the solution")
.IsDependentOn("Clean")
.IsDependentOn("Restore-NuGet-Packages")
.Does(() =>
{
DotNetCoreBuild("./**/project.json", new DotNetCoreBuildSettings {
Configuration = configuration,
Verbose = false
});
//var projects = GetFiles("./**/*.xproj");
// if (IsRunningOnUnix())
// {
// projects = projects
// - GetFiles("./**/Nancy.Encryption.MachineKey.xproj");
// }
// foreach(var project in projects)
// {
// DotNetCoreBuild(project.GetDirectory().FullPath, new DotNetCoreBuildSettings {
// Configuration = configuration,
// Verbose = false,
// //Runtime = IsRunningOnWindows() ? null : "unix-x64"
// });
// }
});
Task("Test")
.Description("Executes xUnit tests")
.WithCriteria(!skipTests)
.IsDependentOn("Compile")
.Does(() =>
{
var projects = GetFiles("./test/**/*.xproj")
- GetFiles("./test/**/*.Performance.xproj");
foreach(var project in projects)
{
DotNetCoreTest(project.GetDirectory().FullPath, new DotNetCoreTestSettings
{
Configuration = configuration,
Verbose = false
});
// if (IsRunningOnWindows())
// {
// DotNetCoreTest(project.GetDirectory().FullPath, new DotNetCoreTestSettings {
// Configuration = configuration
// });
// }
// else
// {
// // For when test projects are set to run against netstandard
// // DotNetCoreTest(project.GetDirectory().FullPath, new DotNetCoreTestSettings {
// // Configuration = configuration,
// // Framework = "netstandard1.3",
// // Runtime = "unix-64"
// // });
// var dirPath = project.GetDirectory().FullPath;
// var testFile = project.GetFilenameWithoutExtension();
// using(var process = StartAndReturnProcess("mono", new ProcessSettings{Arguments =
// dirPath + "/bin/" + configuration + "/net451/unix-x64/dotnet-test-xunit.exe" + " " +
// dirPath + "/bin/" + configuration + "/net451/unix-x64/" + testFile + ".dll"}))
// {
// process.WaitForExit();
// if (process.GetExitCode() != 0)
// {
// throw new Exception("Mono tests failed");
// }
// }
// }
}
});
Task("Package-NuGet")
.Description("Generates NuGet packages for each project that contains a nuspec")
.Does(() =>
{
var projects = GetFiles("./src/**/*.xproj");
foreach(var project in projects)
{
var settings = new DotNetCorePackSettings {
Configuration = configuration,
OutputDirectory = outputNuGet
};
DotNetCorePack(project.GetDirectory().FullPath, settings);
}
});
Task("Publish-NuGet")
.Description("Pushes the nuget packages in the nuget folder to a NuGet source. Also publishes the packages into the feeds.")
.Does(() =>
{
// Make sure we have an API key.
if(string.IsNullOrWhiteSpace(apiKey)){
throw new CakeException("No NuGet API key provided.");
}
// Upload every package to the provided NuGet source (defaults to nuget.org).
var packages = GetFiles(outputNuGet.Path.FullPath + "/*" + version + ".nupkg");
foreach(var package in packages)
{
NuGetPush(package, new NuGetPushSettings {
Source = source,
ApiKey = apiKey
});
}
});
///////////////////////////////////////////////////////////////
Task("Benchmark")
.Description("Runs benchmarks")
.IsDependentOn("Compile")
.Does(() =>
{
StartProcess(nuget.ToString() + "/nuget.exe", "install NBench.Runner -OutputDirectory packages -ExcludeVersion -Version 0.3.1");
var libraries = GetFiles("./test/**/bin/" + configuration + "/net451/*.Performance.dll");
CreateDirectory(outputPerfResults);
var nbenchTestPath = GetFiles("./packages/NBench.Runner*/**/NBench.Runner.exe").First();
foreach (var lib in libraries)
{
Information("Using NBench.Runner: {0}", lib);
var nbenchArgs = new StringBuilder()
.Append(" " + lib)
.Append($" output-directory=\"{outputPerfResults}\"")
.Append(" concurrent=\"true\"");
int result = StartProcess(nbenchTestPath, new ProcessSettings { Arguments = nbenchArgs.ToString(), WorkingDirectory = lib.GetDirectory() } );
if (result != 0)
{
throw new CakeException($"NBench.Runner failed. {nbenchTestPath} {nbenchArgs}");
}
}
});
///////////////////////////////////////////////////////////////
Task("Tag")
.Description("Tags the current release.")
.Does(() =>
{
StartProcess("git", new ProcessSettings {
Arguments = string.Format("tag \"v{0}\"", version)
});
});
Task("Prepare-Release")
.Does(() =>
{
// Update version.
UpdateProjectJsonVersion(version, projectJsonFiles);
// Add
foreach (var file in projectJsonFiles)
{
if (nogit)
{
Information("git " + string.Format("add {0}", file.FullPath));
}
else
{
StartProcess("git", new ProcessSettings {
Arguments = string.Format("add {0}", file.FullPath)
});
}
}
// Commit
if (nogit)
{
Information("git " + string.Format("commit -m \"Updated version to {0}\"", version));
}
else
{
StartProcess("git", new ProcessSettings {
Arguments = string.Format("commit -m \"Updated version to {0}\"", version)
});
}
// Tag
if (nogit)
{
Information("git " + string.Format("tag \"v{0}\"", version));
}
else
{
StartProcess("git", new ProcessSettings {
Arguments = string.Format("tag \"v{0}\"", version)
});
}
//Push
if (nogit)
{
Information("git push origin master");
Information("git push --tags");
}
else
{
StartProcess("git", new ProcessSettings {
Arguments = "push origin master"
});
StartProcess("git", new ProcessSettings {
Arguments = "push --tags"
});
}
});
Task("Update-Version")
.Does(() =>
{
if(string.IsNullOrWhiteSpace(version)) {
throw new CakeException("No version specified!");
}
UpdateProjectJsonVersion(version, projectJsonFiles);
});
///////////////////////////////////////////////////////////////
public void UpdateProjectJsonVersion(string version, FilePathCollection filePaths)
{
Verbose(logAction => logAction("Setting version to {0}", version));
foreach (var file in filePaths)
{
var project = System.IO.File.ReadAllText(file.FullPath, Encoding.UTF8);
project = System.Text.RegularExpressions.Regex.Replace(project, "(\"version\":\\s*)\".+\"", "$1\"" + version + "\"");
System.IO.File.WriteAllText(file.FullPath, project, Encoding.UTF8);
}
}
Task("Default")
.IsDependentOn("Test")
//.IsDependentOn("Update-Version")
.IsDependentOn("Package-NuGet");
Task("Mono")
.IsDependentOn("Test");
Task("PR")
.IsDependentOn("Test")
.IsDependentOn("Benchmark")
.IsDependentOn("Package-NuGet");
Task("Nightly")
.IsDependentOn("Update-Version")
.IsDependentOn("Package-NuGet");
///////////////////////////////////////////////////////////////
RunTarget(target);

Просмотреть файл

@ -1,37 +0,0 @@
@echo off
pushd %~dp0
SETLOCAL
SET CACHED_NUGET=%LocalAppData%\NuGet\NuGet.exe
IF EXIST %CACHED_NUGET% goto copynuget
echo Downloading latest version of NuGet.exe...
IF NOT EXIST %LocalAppData%\NuGet md %LocalAppData%\NuGet
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest 'https://www.nuget.org/nuget.exe' -OutFile '%CACHED_NUGET%'"
:copynuget
IF EXIST .nuget\nuget.exe goto restore
md .nuget
copy %CACHED_NUGET% .nuget\nuget.exe > nul
:restore
.nuget\NuGet.exe update -self
.nuget\NuGet.exe install FAKE -OutputDirectory packages -ExcludeVersion -Version 4.25.4
.nuget\NuGet.exe install xunit.runner.console -OutputDirectory packages\FAKE -ExcludeVersion -Version 2.1.0
.nuget\NuGet.exe install NBench.Runner -OutputDirectory packages -ExcludeVersion -Version 0.2.2
if not exist packages\SourceLink.Fake\tools\SourceLink.fsx (
.nuget\nuget.exe install SourceLink.Fake -OutputDirectory packages -ExcludeVersion
)
rem cls
set encoding=utf-8
packages\FAKE\tools\FAKE.exe build.fsx %*
popd

461
build.fsx
Просмотреть файл

@ -1,461 +0,0 @@
#I @"packages/FAKE/tools"
#r "FakeLib.dll"
open System
open System.IO
open System.Text
open Fake
open Fake.FileUtils
open Fake.TaskRunnerHelper
open Fake.StrongNamingHelper
open Fake.Testing.XUnit2
//--------------------------------------------------------------------------------
// Information about the project for Nuget and Assembly info files
//-------------------------------------------------------------------------------
let product = "DotNetty"
let authors = [ "Microsoft Azure" ]
let copyright = "Copyright © 2016"
let company = "DotNetty"
let description = "High performance, reactive TCP / UDP socket middleware for .NET"
let tags = ["socket";"sockets";"UDP";"TCP";"Netty";"DotNetty"]
let configuration = "Release"
// Read release notes and version
let parsedRelease =
File.ReadLines "RELEASE_NOTES.md"
|> ReleaseNotesHelper.parseReleaseNotes
let envBuildNumber = System.Environment.GetEnvironmentVariable("BUILD_NUMBER") //populated by TeamCity build agent
let buildNumber = if String.IsNullOrWhiteSpace(envBuildNumber) then "0" else envBuildNumber
let version = parsedRelease.AssemblyVersion + "." + buildNumber
let preReleaseVersion = version + "-beta" //suffixes the assembly for pre-releases
let isUnstableDocs = hasBuildParam "unstable"
let isPreRelease = hasBuildParam "nugetprerelease"
let release = if isPreRelease then ReleaseNotesHelper.ReleaseNotes.New(version, version + "-beta", parsedRelease.Notes) else parsedRelease
//--------------------------------------------------------------------------------
// Directories
let binDir = "bin"
let testOutput = FullName "TestResults"
let perfOutput = FullName "PerfResults"
let nugetDir = binDir @@ "nuget"
let workingDir = binDir @@ "build"
let nugetExe = FullName @".nuget\NuGet.exe"
open Fake.RestorePackageHelper
Target "RestorePackages" (fun _ ->
"./DotNetty.sln"
|> RestoreMSSolutionPackages (fun p ->
{ p with
OutputPath = "./packages"
Retries = 4 })
)
//--------------------------------------------------------------------------------
// Clean build results
Target "Clean" (fun _ ->
DeleteDir binDir
)
//--------------------------------------------------------------------------------
// Generate AssemblyInfo files with the version for release notes
open AssemblyInfoFile
Target "AssemblyInfo" (fun _ ->
let version = release.AssemblyVersion
let signKey = getBuildParamOrDefault "signKey" ""
let delaySign =
match signKey with
| s as string when s.Length > 0 -> Some(true)
| _ -> None
CreateCSharpAssemblyInfoWithConfig "src/SharedAssemblyInfo.cs" [
Attribute.Company company
Attribute.Copyright copyright
Attribute.KeyFile signKey
Attribute.DelaySign delaySign
Attribute.Version version
Attribute.FileVersion version ] <| AssemblyInfoFileConfig(false)
)
//--------------------------------------------------------------------------------
// Build the solution
Target "Build" (fun _ ->
!!"DotNetty.sln"
|> MSBuildRelease "" "Rebuild"
|> ignore
)
//--------------------------------------------------------------------------------
// Build the solution
Target "BuildSignedConfig" (fun _ ->
!!"DotNetty.sln"
|> MSBuild "" "Rebuild" ["Configuration", "Signed"]
|> ignore
)
//--------------------------------------------------------------------------------
// Copy the build output to bin directory
//--------------------------------------------------------------------------------
Target "CopyOutput" (fun _ ->
let copyOutput project =
let src = "src" @@ project @@ "bin" @@ "Release"
let dst = binDir @@ project
CopyDir dst src allFiles
[ "DotNetty.Buffers"
"DotNetty.Common"
"DotNetty.Transport"
"DotNetty.Codecs"
"DotNetty.Handlers"
"DotNetty.Codecs.Mqtt"
"DotNetty.Codecs.Redis"
]
|> List.iter copyOutput
)
//--------------------------------------------------------------------------------
// Copy the build output to bin directory
//--------------------------------------------------------------------------------
Target "ResignAssemblies" (fun _ ->
let reSignKey = getBuildParamOrDefault "reSignKey" ""
let copyOutput project =
let src = "src" @@ project @@ "bin" @@ "Release" @@ project + ".dll"
StrongName (fun x -> x) ("-Ra " + src + " " + reSignKey)
[ "DotNetty.Buffers"
"DotNetty.Common"
"DotNetty.Transport"
"DotNetty.Codecs"
"DotNetty.Handlers"
"DotNetty.Codecs.Mqtt"
"DotNetty.Codecs.Redis"
]
|> List.iter copyOutput
)
Target "BuildRelease" DoNothing
Target "BuildReleaseMono" DoNothing
Target "BuildSigned" DoNothing
//--------------------------------------------------------------------------------
// NBench targets
//--------------------------------------------------------------------------------
Target "NBench" <| fun _ ->
let testSearchPath =
let assemblyFilter = getBuildParamOrDefault "spec-assembly" String.Empty
sprintf "test/**/bin/Release/*%s*.Tests.Performance.dll" assemblyFilter
mkdir perfOutput
let nbenchTestPath = findToolInSubPath "NBench.Runner.exe" "./packages/NBench.Runner*"
let nbenchTestAssemblies = !! testSearchPath
printfn "Using NBench.Runner: %s" nbenchTestPath
let runNBench assembly =
let spec = getBuildParam "include"
let args = new StringBuilder()
|> append assembly
|> append (sprintf "output-directory=\"%s\"" perfOutput)
|> append (sprintf "concurrent=\"%b\"" true)
|> appendIfNotNullOrEmpty spec "include="
|> toText
let result = ExecProcess(fun info ->
info.FileName <- nbenchTestPath
info.WorkingDirectory <- (Path.GetDirectoryName (FullName nbenchTestPath))
info.Arguments <- args) (System.TimeSpan.FromMinutes 60.0) (* long-running task. *)
if result <> 0 then failwithf "NBench.Runner failed. %s %s" nbenchTestPath args
nbenchTestAssemblies |> Seq.iter (runNBench)
//--------------------------------------------------------------------------------
// Clean NBench output
Target "CleanPerf" <| fun _ ->
DeleteDir perfOutput
//--------------------------------------------------------------------------------
// Tests targets
//--------------------------------------------------------------------------------
Target "RunTests" <| fun _ ->
let xunitTestAssemblies = !! "test/**/bin/Release/*.Tests.dll" ++ "test/**/bin/Release/*.Tests.End2End.dll"
mkdir testOutput
let xunitToolPath = findToolInSubPath "xunit.console.exe" "packages/xunit.runner.console*/tools"
printfn "Using XUnit runner: %s" xunitToolPath
xUnit2
(fun p -> { p with XmlOutputPath = Some (testOutput + "/report.xml"); ToolPath = xunitToolPath })
xunitTestAssemblies
//--------------------------------------------------------------------------------
// Clean test output
Target "CleanTests" <| fun _ ->
DeleteDir testOutput
//--------------------------------------------------------------------------------
// Nuget targets
//--------------------------------------------------------------------------------
module Nuget =
// add DotNetty dependency for other projects
let getDependencies project =
match project with
| "DotNetty.Common" -> []
| "DotNetty.Transport" -> ["DotNetty.Common", release.NugetVersion] @ ["DotNetty.Buffers", release.NugetVersion]
| "DotNetty.Codecs" -> ["DotNetty.Common", release.NugetVersion] @ ["DotNetty.Buffers", release.NugetVersion] @ ["DotNetty.Transport", release.NugetVersion]
| "DotNetty.Handlers" -> ["DotNetty.Common", release.NugetVersion] @ ["DotNetty.Buffers", release.NugetVersion] @ ["DotNetty.Transport", release.NugetVersion] @ ["DotNetty.Codecs", release.NugetVersion]
| codecs when (codecs.StartsWith("DotNetty.Codecs.")) -> ["DotNetty.Common", release.NugetVersion] @ ["DotNetty.Buffers", release.NugetVersion] @ ["DotNetty.Transport", release.NugetVersion] @ ["DotNetty.Codecs", release.NugetVersion]
| _ -> ["DotNetty.Common", release.NugetVersion]
// used to add -pre suffix to pre-release packages
let getProjectVersion project =
match project with
| _ -> release.NugetVersion
open Nuget
//--------------------------------------------------------------------------------
// Clean nuget directory
Target "CleanNuget" (fun _ ->
CleanDir nugetDir
)
//--------------------------------------------------------------------------------
// Pack nuget for all projects
// Publish to nuget.org if nugetkey is specified
let createNugetPackages _ =
let nugetSuffix = getBuildParamOrDefault "nugetSuffix" ""
let mutable dirName = 1
let removeDir dir =
let del _ =
DeleteDir dir
not (directoryExists dir)
runWithRetries del 3 |> ignore
let getDirName workingDir dirCount =
workingDir + dirCount.ToString()
CleanDir workingDir
ensureDirectory nugetDir
for nuspec in !! "src/**/*.nuspec" do
printfn "Creating nuget packages for %s" nuspec
let project = Path.GetFileNameWithoutExtension nuspec
let projectDir = Path.GetDirectoryName nuspec
let projectFile = (!! (projectDir @@ project + ".*sproj")) |> Seq.head
let releaseDir = projectDir @@ @"bin\Release"
let packages = projectDir @@ "packages.config"
let packageDependencies = if (fileExists packages) then (getDependencies packages) else []
let dependencies = packageDependencies @ (getDependencies project |> List.map (fun x -> fst x + nugetSuffix, snd x))
let releaseVersion = getProjectVersion project
let pack outputDir symbolPackage =
NuGetHelper.NuGet
(fun p ->
{ p with
Description = description
Authors = authors
Copyright = copyright
Project = project + nugetSuffix
Properties = ["Configuration", "Release"]
ReleaseNotes = release.Notes |> String.concat "\n"
Version = releaseVersion
Tags = tags |> String.concat " "
OutputPath = outputDir
WorkingDir = workingDir
SymbolPackage = symbolPackage
Dependencies = dependencies })
nuspec
// Copy dll, pdb and xml to libdir = workingDir/lib/net45/
let libDir = workingDir @@ @"lib\net45"
printfn "Creating output directory %s" libDir
ensureDirectory libDir
CleanDir libDir
!! (releaseDir @@ project + ".dll")
++ (releaseDir @@ project + ".pdb")
++ (releaseDir @@ project + ".xml")
|> CopyFiles libDir
// Copy all src-files (.cs and .fs files) to workingDir/src
let nugetSrcDir = workingDir @@ @"src/"
CleanDir nugetSrcDir
let isCs = hasExt ".cs"
let isFs = hasExt ".fs"
let isAssemblyInfo f = (filename f).Contains("AssemblyInfo")
let isSrc f = (isCs f || isFs f) && not (isAssemblyInfo f)
CopyDir nugetSrcDir projectDir isSrc
//Remove workingDir/src/obj and workingDir/src/bin
removeDir (nugetSrcDir @@ "obj")
removeDir (nugetSrcDir @@ "bin")
// Create both normal nuget package and symbols nuget package.
// Uses the files we copied to workingDir and outputs to nugetdir
pack nugetDir NugetSymbolPackage.Nuspec
let publishNugetPackages _ =
let rec publishPackage url accessKey trialsLeft packageFile =
let tracing = enableProcessTracing
enableProcessTracing <- false
let args p =
match p with
| (pack, key, "") -> sprintf "push \"%s\" %s" pack key
| (pack, key, url) -> sprintf "push \"%s\" %s -source %s" pack key url
tracefn "Pushing %s Attempts left: %d" (FullName packageFile) trialsLeft
try
let result = ExecProcess (fun info ->
info.FileName <- nugetExe
info.WorkingDirectory <- (Path.GetDirectoryName (FullName packageFile))
info.Arguments <- args (packageFile, accessKey,url)) (System.TimeSpan.FromMinutes 1.0)
enableProcessTracing <- tracing
if result <> 0 then failwithf "Error during NuGet symbol push. %s %s" nugetExe (args (packageFile, "key omitted",url))
with exn ->
if (trialsLeft > 0) then (publishPackage url accessKey (trialsLeft-1) packageFile)
else raise exn
let shouldPushNugetPackages = hasBuildParam "nugetkey"
let shouldPushSymbolsPackages = (hasBuildParam "symbolspublishurl") && (hasBuildParam "symbolskey")
if (shouldPushNugetPackages || shouldPushSymbolsPackages) then
printfn "Pushing nuget packages"
if shouldPushNugetPackages then
let normalPackages=
!! (nugetDir @@ "*.nupkg")
-- (nugetDir @@ "*.symbols.nupkg") |> Seq.sortBy(fun x -> x.ToLower())
for package in normalPackages do
publishPackage (getBuildParamOrDefault "nugetpublishurl" "") (getBuildParam "nugetkey") 3 package
if shouldPushSymbolsPackages then
let symbolPackages= !! (nugetDir @@ "*.symbols.nupkg") |> Seq.sortBy(fun x -> x.ToLower())
for package in symbolPackages do
publishPackage (getBuildParam "symbolspublishurl") (getBuildParam "symbolskey") 3 package
Target "Nuget" <| fun _ ->
createNugetPackages()
publishNugetPackages()
Target "CreateNuget" <| fun _ ->
createNugetPackages()
Target "PublishNuget" <| fun _ ->
publishNugetPackages()
Target "NugetSigned" <| fun _ ->
createNugetPackages()
publishNugetPackages()
//--------------------------------------------------------------------------------
// Help
//--------------------------------------------------------------------------------
Target "Help" <| fun _ ->
List.iter printfn [
"usage:"
"build [target]"
""
" Targets for building:"
" * Build Builds"
" * Nuget Create and optionally publish nugets packages"
" * RunTests Runs tests"
" * All Builds, run tests, creates and optionally publish nuget packages"
""
" Other Targets"
" * Help Display this help"
" * HelpNuget Display help about creating and pushing nuget packages"
""]
Target "HelpNuget" <| fun _ ->
List.iter printfn [
"usage: "
"build Nuget [nugetkey=<key> [nugetpublishurl=<url>]] "
" [symbolskey=<key> symbolspublishurl=<url>] "
" [nugetprerelease=<prefix>]"
""
"Arguments for Nuget target:"
" nugetprerelease=<prefix> Creates a pre-release package."
" The version will be version-prefix<date>"
" Example: nugetprerelease=dev =>"
" 0.6.3-dev1408191917"
""
"In order to publish a nuget package, keys must be specified."
"If a key is not specified the nuget packages will only be created on disk"
"After a build you can find them in bin/nuget"
""
"For pushing nuget packages to nuget.org and symbols to symbolsource.org"
"you need to specify nugetkey=<key>"
" build Nuget nugetKey=<key for nuget.org>"
""
"For pushing the ordinary nuget packages to another place than nuget.org specify the url"
" nugetkey=<key> nugetpublishurl=<url> "
""
"For pushing symbols packages specify:"
" symbolskey=<key> symbolspublishurl=<url> "
""
"Examples:"
" build Nuget Build nuget packages to the bin/nuget folder"
""
" build Nuget nugetprerelease=dev Build pre-release nuget packages"
""
" build Nuget nugetkey=123 Build and publish to nuget.org and symbolsource.org"
""
" build Nuget nugetprerelease=dev nugetkey=123 nugetpublishurl=http://abc"
" symbolskey=456 symbolspublishurl=http://xyz"
" Build and publish pre-release nuget packages to http://abc"
" and symbols packages to http://xyz"
""]
//--------------------------------------------------------------------------------
// Target dependencies
//--------------------------------------------------------------------------------
Target "Mono" DoNothing
Target "All" DoNothing
// build dependencies
"Clean" ==> "AssemblyInfo" ==> "RestorePackages" ==> "Build" ==> "CopyOutput" ==> "BuildRelease"
// build dependencies
"Clean" ==> "AssemblyInfo" ==> "RestorePackages" ==> "BuildSignedConfig" ==> "ResignAssemblies" ==> "BuildSigned"
// tests dependencies
"CleanTests" ==> "RunTests"
// NBench dependencies
"BuildRelease" ==> "NBench"
"CleanPerf" ==> "NBench"
// nuget dependencies
"CleanNuget" ==> "BuildRelease" ==> "Nuget"
"CleanNuget" ==> "BuildSigned" ==> "NugetSigned"
"BuildRelease" ==> "All"
"RunTests" ==> "All"
"NBench" ==> "All"
"Nuget" ==> "All"
Target "AllTests" DoNothing //used for Mono builds, due to Mono 4.0 bug with FAKE / NuGet https://github.com/fsharp/fsharp/issues/427
"BuildRelease" ==> "AllTests"
"RunTests" ==> "AllTests"
RunTargetOrDefault "Help"

96
build.ps1 Normal file
Просмотреть файл

@ -0,0 +1,96 @@
$CakeVersion = "0.16.2"
$DotNetVersion = "1.0.0-preview2-003131";
$DotNetInstallerUri = "https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0-preview2/scripts/obtain/dotnet-install.ps1";
# Make sure tools folder exists
$PSScriptRoot = $pwd
$ToolPath = Join-Path $PSScriptRoot "tools"
if (!(Test-Path $ToolPath)) {
Write-Verbose "Creating tools directory..."
New-Item -Path $ToolPath -Type directory | out-null
}
###########################################################################
# INSTALL .NET CORE CLI
###########################################################################
Function Remove-PathVariable([string]$VariableToRemove)
{
$path = [Environment]::GetEnvironmentVariable("PATH", "User")
if ($path -ne $null)
{
$newItems = $path.Split(';', [StringSplitOptions]::RemoveEmptyEntries) | Where-Object { "$($_)" -inotlike $VariableToRemove }
[Environment]::SetEnvironmentVariable("PATH", [System.String]::Join(';', $newItems), "User")
}
$path = [Environment]::GetEnvironmentVariable("PATH", "Process")
if ($path -ne $null)
{
$newItems = $path.Split(';', [StringSplitOptions]::RemoveEmptyEntries) | Where-Object { "$($_)" -inotlike $VariableToRemove }
[Environment]::SetEnvironmentVariable("PATH", [System.String]::Join(';', $newItems), "Process")
}
}
# Get .NET Core CLI path if installed.
$FoundDotNetCliVersion = $null;
if (Get-Command dotnet -ErrorAction SilentlyContinue) {
$FoundDotNetCliVersion = dotnet --version;
}
if($FoundDotNetCliVersion -ne $DotNetVersion) {
$InstallPath = Join-Path $PSScriptRoot ".dotnet"
if (!(Test-Path $InstallPath)) {
mkdir -Force $InstallPath | Out-Null;
}
(New-Object System.Net.WebClient).DownloadFile($DotNetInstallerUri, "$InstallPath\dotnet-install.ps1");
& $InstallPath\dotnet-install.ps1 -Channel preview -Version $DotNetVersion -InstallDir $InstallPath;
Remove-PathVariable "$InstallPath"
$env:PATH = "$InstallPath;$env:PATH"
$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
$env:DOTNET_CLI_TELEMETRY_OPTOUT=1
& dotnet --info
}
###########################################################################
# INSTALL CAKE
###########################################################################
Add-Type -AssemblyName System.IO.Compression.FileSystem
Function Unzip
{
param([string]$zipfile, [string]$outpath)
[System.IO.Compression.ZipFile]::ExtractToDirectory($zipfile, $outpath)
}
# Make sure Cake has been installed.
$CakePath = Join-Path $ToolPath "Cake.CoreCLR.$CakeVersion/Cake.dll"
if (!(Test-Path $CakePath)) {
Write-Host "Installing Cake..."
(New-Object System.Net.WebClient).DownloadFile("https://www.nuget.org/api/v2/package/Cake.CoreCLR/$CakeVersion", "$ToolPath\Cake.CoreCLR.zip")
Unzip "$ToolPath\Cake.CoreCLR.zip" "$ToolPath/Cake.CoreCLR.$CakeVersion"
Remove-Item "$ToolPath\Cake.CoreCLR.zip"
}
###########################################################################
# INSTALL NUGET
###########################################################################
# Make sure NuGet has been installed.
$NugetPath = Join-Path $PSScriptRoot ".nuget/nuget.exe"
if (!(Test-Path $NugetPath)) {
Write-Host "Installing Nuget..."
(New-Object System.Net.WebClient).DownloadFile("https://www.nuget.org/nuget.exe", $NugetPath)
& "$NugetPath" update -self
}
###########################################################################
# RUN BUILD SCRIPT
###########################################################################
& dotnet "$CakePath" $args
exit $LASTEXITCODE

Просмотреть файл

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<appSettings>
<add key="ssl" value="True" />
<add key="host" value="127.0.0.1" />
<add key="port" value="8007" />
<add key="size" value="256"/>
</appSettings>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

Просмотреть файл

@ -1,98 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{124620F1-A3B6-4B8D-9954-61BF2021DF39}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Discard.Client</RootNamespace>
<AssemblyName>Discard.Client</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Practices.EnterpriseLibrary.SemanticLogging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\packages\EnterpriseLibrary.SemanticLogging.2.0.1406.1\lib\net45\Microsoft.Practices.EnterpriseLibrary.SemanticLogging.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
</ItemGroup>
<ItemGroup>
<Compile Include="DiscardSettings.cs" />
<Compile Include="DiscardClientHandler.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="..\..\shared\dotnetty.com.pfx">
<Link>dotnetty.com.pfx</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<None Include="App.config">
<SubType>Designer</SubType>
</None>
<None Include="packages.config">
<SubType>
</SubType>
</None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\DotNetty.Buffers\DotNetty.Buffers.csproj">
<Project>{5de3c557-48bf-4cdb-9f47-474d343dd841}</Project>
<Name>DotNetty.Buffers</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\DotNetty.Codecs\DotNetty.Codecs.csproj">
<Project>{2abd244e-ef8f-460d-9c30-39116499e6e4}</Project>
<Name>DotNetty.Codecs</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\DotNetty.Common\DotNetty.Common.csproj">
<Project>{de58fe41-5e99-44e5-86bc-fc9ed8761daf}</Project>
<Name>DotNetty.Common</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\DotNetty.Handlers\DotNetty.Handlers.csproj">
<Project>{09628314-f44e-445e-9f0d-cbe33b736ac3}</Project>
<Name>DotNetty.Handlers</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\DotNetty.Transport\DotNetty.Transport.csproj">
<Project>{8218c9ee-0a4a-432f-a12a-b54202f97b05}</Project>
<Name>DotNetty.Transport</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

Просмотреть файл

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>6109c1db-327d-439b-a0c0-6dd63f1d3dea</ProjectGuid>
<RootNamespace>Discard.Client</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>

Просмотреть файл

@ -6,23 +6,22 @@ namespace Discard.Client
using System;
using DotNetty.Buffers;
using DotNetty.Transport.Channels;
using Examples.Common;
public class DiscardClientHandler : SimpleChannelInboundHandler<object>
{
private IChannelHandlerContext ctx;
private byte[] array;
IChannelHandlerContext ctx;
byte[] array;
public override void ChannelActive(IChannelHandlerContext ctx)
{
this.array = new byte[DiscardClientSettings.Size];
this.array = new byte[ClientSettings.Size];
this.ctx = ctx;
// Send the initial messages.
this.GenerateTraffic();
}
protected override void ChannelRead0(IChannelHandlerContext context, object message)
{
// Server is supposed to send nothing, but if it sends something, discard it.
@ -34,7 +33,7 @@ namespace Discard.Client
this.ctx.CloseAsync();
}
private async void GenerateTraffic()
async void GenerateTraffic()
{
try
{
@ -42,7 +41,7 @@ namespace Discard.Client
// Flush the outbound buffer to the socket.
// Once flushed, generate the same amount of traffic again.
await this.ctx.WriteAndFlushAsync(buffer);
GenerateTraffic();
this.GenerateTraffic();
}
catch
{

Просмотреть файл

@ -1,24 +0,0 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace Discard.Client
{
using System.Configuration;
using System.Net;
public static class DiscardClientSettings
{
public static bool IsSsl
{
get
{
string ssl = System.Configuration.ConfigurationManager.AppSettings["ssl"];
return !string.IsNullOrEmpty(ssl) && bool.Parse(ssl);
}
}
public static IPAddress Host => IPAddress.Parse(ConfigurationManager.AppSettings["host"]);
public static int Port => int.Parse(ConfigurationManager.AppSettings["port"]);
public static int Size => int.Parse(ConfigurationManager.AppSettings["size"]);
}
}

Просмотреть файл

@ -4,34 +4,31 @@
namespace Discard.Client
{
using System;
using System.Diagnostics.Tracing;
using System.IO;
using System.Net;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
using System.Threading.Tasks;
using DotNetty.Codecs;
using DotNetty.Common.Internal.Logging;
using DotNetty.Handlers.Logging;
using DotNetty.Handlers.Tls;
using DotNetty.Transport.Bootstrapping;
using DotNetty.Transport.Channels;
using DotNetty.Transport.Channels.Sockets;
using Microsoft.Practices.EnterpriseLibrary.SemanticLogging;
using Examples.Common;
class Program
{
static async Task RunClientAsync()
{
var eventListener = new ObservableEventListener();
eventListener.LogToConsole();
eventListener.EnableEvents(DefaultEventSource.Log, EventLevel.Verbose);
ExampleHelper.SetConsoleLogger();
var group = new MultithreadEventLoopGroup();
X509Certificate2 cert = null;
string targetHost = null;
if (DiscardClientSettings.IsSsl)
if (ClientSettings.IsSsl)
{
cert = new X509Certificate2("dotnetty.com.pfx", "password");
cert = new X509Certificate2(Path.Combine(ExampleHelper.ProcessDirectory, "shared\\dotnetty.com.pfx"), "password");
targetHost = cert.GetNameInfo(X509NameType.DnsName, false);
}
try
@ -50,10 +47,11 @@ namespace Discard.Client
pipeline.AddLast(new TlsHandler(stream => new SslStream(stream, true, (sender, certificate, chain, errors) => true), new ClientTlsSettings(targetHost)));
}
pipeline.AddLast(new LoggingHandler());
pipeline.AddLast(new DiscardClientHandler());
}));
IChannel bootstrapChannel = await bootstrap.ConnectAsync(new IPEndPoint(DiscardClientSettings.Host, DiscardClientSettings.Port));
IChannel bootstrapChannel = await bootstrap.ConnectAsync(new IPEndPoint(ClientSettings.Host, ClientSettings.Port));
Console.ReadLine();
@ -62,10 +60,9 @@ namespace Discard.Client
finally
{
group.ShutdownGracefullyAsync().Wait(1000);
eventListener.Dispose();
}
}
static void Main() => RunClientAsync().Wait();
public static void Main() => RunClientAsync().Wait();
}
}

Просмотреть файл

@ -0,0 +1,6 @@
{
"ssl": "true",
"host": "127.0.0.1",
"port": "8007",
"size": "256"
}

Просмотреть файл

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="EnterpriseLibrary.SemanticLogging" version="2.0.1406.1" targetFramework="net45" />
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net45" />
</packages>

Просмотреть файл

@ -0,0 +1,42 @@
{
"name": "Discard.Client",
"description": "Example of client for Discarding Server",
"buildOptions": {
"emitEntryPoint": true,
"copyToOutput": {
"include": [ "appsettings.json", "..\\..\\shared\\dotnetty.com.pfx" ]
}
},
"dependencies": {
"DotNetty.Common": {
"target": "project"
},
"DotNetty.Buffers": {
"target": "project"
},
"DotNetty.Transport": {
"target": "project"
},
"DotNetty.Handlers": {
"target": "project"
},
"DotNetty.Codecs": {
"target": "project"
},
"Examples.Common": {
"target": "project"
}
},
"frameworks": {
"netcoreapp1.0": {
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.0-*",
"type": "platform"
}
},
"imports": "dnxcore50"
},
"net451": {}
}
}

Просмотреть файл

@ -1,18 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<appSettings>
<add key="ssl" value="True" />
<add key="port" value="8007" />
</appSettings>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

Просмотреть файл

@ -1,96 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{821D5A3F-F4CD-4579-A0A0-95F6770F1DC4}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Discard.Server</RootNamespace>
<AssemblyName>Discard.Server</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Practices.EnterpriseLibrary.SemanticLogging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\packages\EnterpriseLibrary.SemanticLogging.2.0.1406.1\lib\net45\Microsoft.Practices.EnterpriseLibrary.SemanticLogging.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
</ItemGroup>
<ItemGroup>
<Compile Include="DiscardServerHandler.cs" />
<Compile Include="DiscardSettings.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="..\..\shared\dotnetty.com.pfx">
<Link>dotnetty.com.pfx</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<None Include="App.config" />
<None Include="packages.config">
<SubType>
</SubType>
</None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\DotNetty.Buffers\DotNetty.Buffers.csproj">
<Project>{5de3c557-48bf-4cdb-9f47-474d343dd841}</Project>
<Name>DotNetty.Buffers</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\DotNetty.Codecs\DotNetty.Codecs.csproj">
<Project>{2abd244e-ef8f-460d-9c30-39116499e6e4}</Project>
<Name>DotNetty.Codecs</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\DotNetty.Common\DotNetty.Common.csproj">
<Project>{de58fe41-5e99-44e5-86bc-fc9ed8761daf}</Project>
<Name>DotNetty.Common</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\DotNetty.Handlers\DotNetty.Handlers.csproj">
<Project>{09628314-f44e-445e-9f0d-cbe33b736ac3}</Project>
<Name>DotNetty.Handlers</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\DotNetty.Transport\DotNetty.Transport.csproj">
<Project>{8218c9ee-0a4a-432f-a12a-b54202f97b05}</Project>
<Name>DotNetty.Transport</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

Просмотреть файл

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>821d5a3f-f4cd-4579-a0a0-95f6770f1dc4</ProjectGuid>
<RootNamespace>Discard.Server</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>

Просмотреть файл

@ -4,10 +4,8 @@
namespace Discard.Server
{
using System;
using DotNetty.Buffers;
using DotNetty.Transport.Channels;
public class DiscardServerHandler : SimpleChannelInboundHandler<object>
{
protected override void ChannelRead0(IChannelHandlerContext context, object message)

Просмотреть файл

@ -1,21 +0,0 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace Discard.Server
{
using System.Configuration;
public static class DiscardSettings
{
public static bool IsSsl
{
get
{
string ssl = System.Configuration.ConfigurationManager.AppSettings["ssl"];
return !string.IsNullOrEmpty(ssl) && bool.Parse(ssl);
}
}
public static int Port => int.Parse(ConfigurationManager.AppSettings["port"]);
}
}

Просмотреть файл

@ -4,33 +4,28 @@
namespace Discard.Server
{
using System;
using System.Diagnostics.Tracing;
using System.Net.Security;
using System.IO;
using System.Security.Cryptography.X509Certificates;
using System.Threading.Tasks;
using DotNetty.Codecs;
using DotNetty.Common.Internal.Logging;
using DotNetty.Handlers.Logging;
using DotNetty.Handlers.Tls;
using DotNetty.Transport.Bootstrapping;
using DotNetty.Transport.Channels;
using DotNetty.Transport.Channels.Sockets;
using Microsoft.Practices.EnterpriseLibrary.SemanticLogging;
using Examples.Common;
class Program
{
static async Task RunServerAsync()
{
var eventListener = new ObservableEventListener();
eventListener.LogToConsole();
eventListener.EnableEvents(DefaultEventSource.Log, EventLevel.LogAlways);
ExampleHelper.SetConsoleLogger();
var bossGroup = new MultithreadEventLoopGroup(1);
var workerGroup = new MultithreadEventLoopGroup();
X509Certificate2 tlsCertificate = null;
if (DiscardSettings.IsSsl)
if (ServerSettings.IsSsl)
{
tlsCertificate = new X509Certificate2("dotnetty.com.pfx", "password");
tlsCertificate = new X509Certificate2(Path.Combine(ExampleHelper.ProcessDirectory, "shared\\dotnetty.com.pfx"), "password");
}
try
{
@ -39,7 +34,7 @@ namespace Discard.Server
.Group(bossGroup, workerGroup)
.Channel<TcpServerSocketChannel>()
.Option(ChannelOption.SoBacklog, 100)
.Handler(new LoggingHandler(LogLevel.INFO))
.Handler(new LoggingHandler("LSTN"))
.ChildHandler(new ActionChannelInitializer<ISocketChannel>(channel =>
{
IChannelPipeline pipeline = channel.Pipeline;
@ -47,10 +42,11 @@ namespace Discard.Server
{
pipeline.AddLast(TlsHandler.Server(tlsCertificate));
}
pipeline.AddLast(new LoggingHandler("CONN"));
pipeline.AddLast(new DiscardServerHandler());
}));
IChannel bootstrapChannel = await bootstrap.BindAsync(DiscardSettings.Port);
IChannel bootstrapChannel = await bootstrap.BindAsync(ServerSettings.Port);
Console.ReadLine();
@ -59,10 +55,9 @@ namespace Discard.Server
finally
{
Task.WaitAll(bossGroup.ShutdownGracefullyAsync(), workerGroup.ShutdownGracefullyAsync());
eventListener.Dispose();
}
}
static void Main() => RunServerAsync().Wait();
public static void Main() => RunServerAsync().Wait();
}
}

Просмотреть файл

@ -0,0 +1,4 @@
{
"ssl": "true",
"port": "8007"
}

Просмотреть файл

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="EnterpriseLibrary.SemanticLogging" version="2.0.1406.1" targetFramework="net45" />
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net45" />
</packages>

Просмотреть файл

@ -0,0 +1,42 @@
{
"name": "Discard.Server",
"description": "Example of Discarding Server",
"buildOptions": {
"emitEntryPoint": true,
"copyToOutput": {
"include": ["appsettings.json", "..\\..\\shared\\dotnetty.com.pfx"]
}
},
"dependencies": {
"DotNetty.Common": {
"target": "project"
},
"DotNetty.Buffers": {
"target": "project"
},
"DotNetty.Transport": {
"target": "project"
},
"DotNetty.Handlers": {
"target": "project"
},
"DotNetty.Codecs": {
"target": "project"
},
"Examples.Common": {
"target": "project"
}
},
"frameworks": {
"netcoreapp1.0": {
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.0-*",
"type": "platform"
}
},
"imports": "dnxcore50"
},
"net451": {}
}
}

Просмотреть файл

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<appSettings>
<add key="ssl" value="True" />
<add key="host" value="127.0.0.1" />
<add key="port" value="8007" />
<add key="size" value="256" />
</appSettings>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

Просмотреть файл

@ -1,26 +0,0 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace Echo.Client
{
using System.Configuration;
using System.Net;
public static class EchoClientSettings
{
public static bool IsSsl
{
get
{
string ssl = ConfigurationManager.AppSettings["ssl"];
return !string.IsNullOrEmpty(ssl) && bool.Parse(ssl);
}
}
public static IPAddress Host => IPAddress.Parse(ConfigurationManager.AppSettings["host"]);
public static int Port => int.Parse(ConfigurationManager.AppSettings["port"]);
public static int Size => int.Parse(ConfigurationManager.AppSettings["size"]);
}
}

Просмотреть файл

@ -1,91 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{C24AB93F-41E9-4291-BA8F-E9D3CF6C2EBC}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Echo.Client</RootNamespace>
<AssemblyName>Echo.Client</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Practices.EnterpriseLibrary.SemanticLogging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\packages\EnterpriseLibrary.SemanticLogging.2.0.1406.1\lib\net45\Microsoft.Practices.EnterpriseLibrary.SemanticLogging.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
</ItemGroup>
<ItemGroup>
<Content Include="..\..\shared\dotnetty.com.pfx">
<Link>dotnetty.com.pfx</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Compile Include="ClientSettings.cs" />
<Compile Include="EchoClientHandler.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\DotNetty.Buffers\DotNetty.Buffers.csproj">
<Project>{5de3c557-48bf-4cdb-9f47-474d343dd841}</Project>
<Name>DotNetty.Buffers</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\DotNetty.Codecs\DotNetty.Codecs.csproj">
<Project>{2abd244e-ef8f-460d-9c30-39116499e6e4}</Project>
<Name>DotNetty.Codecs</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\DotNetty.Common\DotNetty.Common.csproj">
<Project>{de58fe41-5e99-44e5-86bc-fc9ed8761daf}</Project>
<Name>DotNetty.Common</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\DotNetty.Handlers\DotNetty.Handlers.csproj">
<Project>{09628314-f44e-445e-9f0d-cbe33b736ac3}</Project>
<Name>DotNetty.Handlers</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\DotNetty.Transport\DotNetty.Transport.csproj">
<Project>{8218c9ee-0a4a-432f-a12a-b54202f97b05}</Project>
<Name>DotNetty.Transport</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

Просмотреть файл

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>C24AB93F-41E9-4291-BA8F-E9D3CF6C2EBC</ProjectGuid>
<RootNamespace>Echo.Client</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>

Просмотреть файл

@ -7,6 +7,7 @@ namespace Echo.Client
using System.Text;
using DotNetty.Buffers;
using DotNetty.Transport.Channels;
using Examples.Common;
public class EchoClientHandler : ChannelHandlerAdapter
{
@ -14,7 +15,7 @@ namespace Echo.Client
public EchoClientHandler()
{
this.initialMessage = Unpooled.Buffer(EchoClientSettings.Size);
this.initialMessage = Unpooled.Buffer(ClientSettings.Size);
byte[] messageBytes = Encoding.UTF8.GetBytes("Hello world");
this.initialMessage.WriteBytes(messageBytes);
}

Просмотреть файл

@ -4,35 +4,32 @@
namespace Echo.Client
{
using System;
using System.Diagnostics.Tracing;
using System.IO;
using System.Net;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
using System.Threading.Tasks;
using DotNetty.Codecs;
using DotNetty.Common.Internal.Logging;
using DotNetty.Handlers.Logging;
using DotNetty.Handlers.Tls;
using DotNetty.Transport.Bootstrapping;
using DotNetty.Transport.Channels;
using DotNetty.Transport.Channels.Sockets;
using Microsoft.Practices.EnterpriseLibrary.SemanticLogging;
using Examples.Common;
class Program
{
static async Task RunClientAsync()
{
var eventListener = new ObservableEventListener();
eventListener.LogToConsole();
eventListener.EnableEvents(DefaultEventSource.Log, EventLevel.Verbose);
ExampleHelper.SetConsoleLogger();
var group = new MultithreadEventLoopGroup();
X509Certificate2 cert = null;
string targetHost = null;
if (EchoClientSettings.IsSsl)
if (ClientSettings.IsSsl)
{
cert = new X509Certificate2("dotnetty.com.pfx", "password");
cert = new X509Certificate2(Path.Combine(ExampleHelper.ProcessDirectory, "shared\\dotnetty.com.pfx"), "password");
targetHost = cert.GetNameInfo(X509NameType.DnsName, false);
}
try
@ -50,14 +47,14 @@ namespace Echo.Client
{
pipeline.AddLast("tls", new TlsHandler(stream => new SslStream(stream, true, (sender, certificate, chain, errors) => true), new ClientTlsSettings(targetHost)));
}
//pipeline.AddLast(new LoggingHandler("CLIENT"));
pipeline.AddLast(new LoggingHandler());
pipeline.AddLast("framing-enc", new LengthFieldPrepender(2));
pipeline.AddLast("framing-dec", new LengthFieldBasedFrameDecoder(ushort.MaxValue, 0, 2, 0, 2));
pipeline.AddLast("echo", new EchoClientHandler());
}));
IChannel clientChannel = await bootstrap.ConnectAsync(new IPEndPoint(EchoClientSettings.Host, EchoClientSettings.Port));
IChannel clientChannel = await bootstrap.ConnectAsync(new IPEndPoint(ClientSettings.Host, ClientSettings.Port));
Console.ReadLine();
@ -66,7 +63,6 @@ namespace Echo.Client
finally
{
await group.ShutdownGracefullyAsync(TimeSpan.FromMilliseconds(100), TimeSpan.FromSeconds(1));
eventListener.Dispose();
}
}

Просмотреть файл

@ -0,0 +1,6 @@
{
"ssl": "true",
"host": "127.0.0.1",
"port": "8007",
"size": "256"
}

Просмотреть файл

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="EnterpriseLibrary.SemanticLogging" version="2.0.1406.1" targetFramework="net45" />
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net45" />
</packages>

Просмотреть файл

@ -0,0 +1,42 @@
{
"name": "Echo.Client",
"description": "Example of client for Echo Server",
"buildOptions": {
"emitEntryPoint": true,
"copyToOutput": {
"include": [ "appsettings.json", "..\\..\\shared\\dotnetty.com.pfx" ]
}
},
"dependencies": {
"DotNetty.Common": {
"target": "project"
},
"DotNetty.Buffers": {
"target": "project"
},
"DotNetty.Transport": {
"target": "project"
},
"DotNetty.Handlers": {
"target": "project"
},
"DotNetty.Codecs": {
"target": "project"
},
"Examples.Common": {
"target": "project"
}
},
"frameworks": {
"netcoreapp1.0": {
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.0-*",
"type": "platform"
}
},
"imports": "dnxcore50"
},
"net451": {}
}
}

Просмотреть файл

@ -1,18 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<appSettings>
<add key="ssl" value="True" />
<add key="port" value="8007" />
</appSettings>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

Просмотреть файл

@ -1,91 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{BA163586-F875-4488-9188-53A4A14DFD34}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Echo.Server</RootNamespace>
<AssemblyName>Echo.Server</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Practices.EnterpriseLibrary.SemanticLogging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\packages\EnterpriseLibrary.SemanticLogging.2.0.1406.1\lib\net45\Microsoft.Practices.EnterpriseLibrary.SemanticLogging.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
</ItemGroup>
<ItemGroup>
<Content Include="..\..\shared\dotnetty.com.pfx">
<Link>dotnetty.com.pfx</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Compile Include="EchoServerHandler.cs" />
<Compile Include="EchoServerSettings.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\DotNetty.Buffers\DotNetty.Buffers.csproj">
<Project>{5de3c557-48bf-4cdb-9f47-474d343dd841}</Project>
<Name>DotNetty.Buffers</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\DotNetty.Codecs\DotNetty.Codecs.csproj">
<Project>{2abd244e-ef8f-460d-9c30-39116499e6e4}</Project>
<Name>DotNetty.Codecs</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\DotNetty.Common\DotNetty.Common.csproj">
<Project>{de58fe41-5e99-44e5-86bc-fc9ed8761daf}</Project>
<Name>DotNetty.Common</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\DotNetty.Handlers\DotNetty.Handlers.csproj">
<Project>{09628314-f44e-445e-9f0d-cbe33b736ac3}</Project>
<Name>DotNetty.Handlers</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\DotNetty.Transport\DotNetty.Transport.csproj">
<Project>{8218c9ee-0a4a-432f-a12a-b54202f97b05}</Project>
<Name>DotNetty.Transport</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

Просмотреть файл

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>ba163586-f875-4488-9188-53a4a14dfd34</ProjectGuid>
<RootNamespace>Echo.Server</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>

Просмотреть файл

@ -4,32 +4,29 @@
namespace Echo.Server
{
using System;
using System.Diagnostics.Tracing;
using System.IO;
using System.Security.Cryptography.X509Certificates;
using System.Threading.Tasks;
using DotNetty.Codecs;
using DotNetty.Common.Internal.Logging;
using DotNetty.Handlers.Logging;
using DotNetty.Handlers.Tls;
using DotNetty.Transport.Bootstrapping;
using DotNetty.Transport.Channels;
using DotNetty.Transport.Channels.Sockets;
using Microsoft.Practices.EnterpriseLibrary.SemanticLogging;
using Examples.Common;
class Program
{
static async Task RunServerAsync()
{
var eventListener = new ObservableEventListener();
eventListener.LogToConsole();
eventListener.EnableEvents(DefaultEventSource.Log, EventLevel.Verbose);
ExampleHelper.SetConsoleLogger();
var bossGroup = new MultithreadEventLoopGroup(1);
var workerGroup = new MultithreadEventLoopGroup();
X509Certificate2 tlsCertificate = null;
if (EchoServerSettings.IsSsl)
if (ServerSettings.IsSsl)
{
tlsCertificate = new X509Certificate2("dotnetty.com.pfx", "password");
tlsCertificate = new X509Certificate2(Path.Combine(ExampleHelper.ProcessDirectory, "shared\\dotnetty.com.pfx"), "password");
}
try
{
@ -46,14 +43,14 @@ namespace Echo.Server
{
pipeline.AddLast("tls", TlsHandler.Server(tlsCertificate));
}
//pipeline.AddLast(new LoggingHandler("SRV-CONN"));
pipeline.AddLast(new LoggingHandler("SRV-CONN"));
pipeline.AddLast("framing-enc", new LengthFieldPrepender(2));
pipeline.AddLast("framing-dec", new LengthFieldBasedFrameDecoder(ushort.MaxValue, 0, 2, 0, 2));
pipeline.AddLast("echo", new EchoServerHandler());
}));
IChannel boundChannel = await bootstrap.BindAsync(EchoServerSettings.Port);
IChannel boundChannel = await bootstrap.BindAsync(ServerSettings.Port);
Console.ReadLine();
@ -64,7 +61,6 @@ namespace Echo.Server
await Task.WhenAll(
bossGroup.ShutdownGracefullyAsync(TimeSpan.FromMilliseconds(100), TimeSpan.FromSeconds(1)),
workerGroup.ShutdownGracefullyAsync(TimeSpan.FromMilliseconds(100), TimeSpan.FromSeconds(1)));
eventListener.Dispose();
}
}

Просмотреть файл

@ -0,0 +1,4 @@
{
"ssl": "true",
"port": "8007"
}

Просмотреть файл

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="EnterpriseLibrary.SemanticLogging" version="2.0.1406.1" targetFramework="net45" />
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net45" />
</packages>

Просмотреть файл

@ -0,0 +1,42 @@
{
"name": "Echo.Server",
"description": "Example of Echo Server",
"buildOptions": {
"emitEntryPoint": true,
"copyToOutput": {
"include": ["appsettings.json", "..\\..\\shared\\dotnetty.com.pfx"]
}
},
"dependencies": {
"DotNetty.Common": {
"target": "project"
},
"DotNetty.Buffers": {
"target": "project"
},
"DotNetty.Transport": {
"target": "project"
},
"DotNetty.Handlers": {
"target": "project"
},
"DotNetty.Codecs": {
"target": "project"
},
"Examples.Common": {
"target": "project"
}
},
"frameworks": {
"netcoreapp1.0": {
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.0-*",
"type": "platform"
}
},
"imports": "dnxcore50"
},
"net451": {}
}
}

Просмотреть файл

@ -0,0 +1,25 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace Examples.Common
{
using System.Net;
public class ClientSettings
{
public static bool IsSsl
{
get
{
string ssl = ExampleHelper.Configuration["ssl"];
return !string.IsNullOrEmpty(ssl) && bool.Parse(ssl);
}
}
public static IPAddress Host => IPAddress.Parse(ExampleHelper.Configuration["host"]);
public static int Port => int.Parse(ExampleHelper.Configuration["port"]);
public static int Size => int.Parse(ExampleHelper.Configuration["size"]);
}
}

Просмотреть файл

@ -0,0 +1,37 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace Examples.Common
{
using System;
using DotNetty.Common.Internal.Logging;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging.Console;
public static class ExampleHelper
{
static ExampleHelper()
{
Configuration = new ConfigurationBuilder()
.SetBasePath(ProcessDirectory)
.AddJsonFile("appsettings.json")
.Build();
}
public static string ProcessDirectory
{
get
{
#if NETSTANDARD1_3
return AppContext.BaseDirectory;
#else
return AppDomain.CurrentDomain.BaseDirectory;
#endif
}
}
public static IConfigurationRoot Configuration { get; }
public static void SetConsoleLogger() => InternalLoggerFactory.DefaultFactory.AddProvider(new ConsoleLoggerProvider((s, level) => true, false));
}
}

Просмотреть файл

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>fc7f860d-bbc8-42e5-b045-f8d98a8a2fd2</ProjectGuid>
<RootNamespace>Examples.Common</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>

Просмотреть файл

@ -0,0 +1,19 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Examples.Common")]
[assembly: AssemblyTrademark("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("fc7f860d-bbc8-42e5-b045-f8d98a8a2fd2")]

Просмотреть файл

@ -1,21 +1,19 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace Echo.Server
namespace Examples.Common
{
using System.Configuration;
public static class EchoServerSettings
public static class ServerSettings
{
public static bool IsSsl
{
get
{
string ssl = ConfigurationManager.AppSettings["ssl"];
string ssl = ExampleHelper.Configuration["ssl"];
return !string.IsNullOrEmpty(ssl) && bool.Parse(ssl);
}
}
public static int Port => int.Parse(ConfigurationManager.AppSettings["port"]);
public static int Port => int.Parse(ExampleHelper.Configuration["port"]);
}
}

Просмотреть файл

@ -0,0 +1,18 @@
{
"dependencies": {
"NETStandard.Library": "1.6.0",
"Microsoft.Extensions.Configuration": "1.0.0",
"Microsoft.Extensions.Configuration.FileExtensions": "1.0.0",
"Microsoft.Extensions.Configuration.Json": "1.0.0",
"Microsoft.Extensions.Logging.Console": "1.0.0",
"DotNetty.Common": {
"target": "project"
}
},
"frameworks": {
"netstandard1.3": {
},
"net451": {
}
}
}

Просмотреть файл

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<appSettings>
<add key="ssl" value="True" />
<add key="host" value="127.0.0.1" />
<add key="port" value="8007" />
<add key="count" value="100"/>
</appSettings>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

Просмотреть файл

@ -0,0 +1,12 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace Factorial.Client
{
using Examples.Common;
public class ClientSettings : Examples.Common.ClientSettings
{
public static int Count => int.Parse(ExampleHelper.Configuration["count"]);
}
}

Просмотреть файл

@ -1,98 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{E7B7F314-6E72-4CE1-B69C-F5732DCF07F2}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Factorial.Client</RootNamespace>
<AssemblyName>Factorial.Client</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Practices.EnterpriseLibrary.SemanticLogging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\packages\EnterpriseLibrary.SemanticLogging.2.0.1406.1\lib\net45\Microsoft.Practices.EnterpriseLibrary.SemanticLogging.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Numerics" />
</ItemGroup>
<ItemGroup>
<Compile Include="FactorialClientHandler.cs" />
<Compile Include="FactorialSettings.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="..\..\shared\dotnetty.com.pfx">
<Link>dotnetty.com.pfx</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\DotNetty.Buffers\DotNetty.Buffers.csproj">
<Project>{5de3c557-48bf-4cdb-9f47-474d343dd841}</Project>
<Name>DotNetty.Buffers</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\DotNetty.Codecs\DotNetty.Codecs.csproj">
<Project>{2abd244e-ef8f-460d-9c30-39116499e6e4}</Project>
<Name>DotNetty.Codecs</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\DotNetty.Common\DotNetty.Common.csproj">
<Project>{de58fe41-5e99-44e5-86bc-fc9ed8761daf}</Project>
<Name>DotNetty.Common</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\DotNetty.Handlers\DotNetty.Handlers.csproj">
<Project>{09628314-f44e-445e-9f0d-cbe33b736ac3}</Project>
<Name>DotNetty.Handlers</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\DotNetty.Transport\DotNetty.Transport.csproj">
<Project>{8218c9ee-0a4a-432f-a12a-b54202f97b05}</Project>
<Name>DotNetty.Transport</Name>
</ProjectReference>
<ProjectReference Include="..\Factorial\Factorial.csproj">
<Project>{c7559bfc-023f-445e-bab8-e2b5e199b774}</Project>
<Name>Factorial</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

Просмотреть файл

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>e7b7f314-6e72-4ce1-b69c-f5732dcf07f2</ProjectGuid>
<RootNamespace>Factorial.Client</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>

Просмотреть файл

@ -3,49 +3,18 @@
namespace Factorial.Client
{
using System.Numerics;
using System;
using System.Collections.Concurrent;
using System.Numerics;
using DotNetty.Transport.Channels;
public class FactorialClientHandler : SimpleChannelInboundHandler<BigInteger>
{
private IChannelHandlerContext ctx;
private int receivedMessages;
private int next = 1;
readonly ConcurrentQueue<BigInteger> answer = new ConcurrentQueue<BigInteger>();
IChannelHandlerContext ctx;
int receivedMessages;
int next = 1;
readonly BlockingCollection<BigInteger> answer = new BlockingCollection<BigInteger>();
public BigInteger GetFactorial()
{
bool interrupted = false;
BigInteger result = new BigInteger(1);
try
{
for (;;)
{
try
{
if (this.answer.TryDequeue(out result))
return result;
}
catch
{
interrupted = true;
}
}
}
finally
{
if (interrupted)
{
System.Threading.Thread.CurrentThread.Interrupt();
}
}
}
public FactorialClientHandler()
{
}
public BigInteger GetFactorial() => this.answer.Take();
public override void ChannelActive(IChannelHandlerContext ctx)
{
@ -56,22 +25,20 @@ namespace Factorial.Client
protected override void ChannelRead0(IChannelHandlerContext ctx, BigInteger msg)
{
this.receivedMessages++;
this.answer.Enqueue(msg);
if (this.receivedMessages == FactorialClientSettings.Count)
if (this.receivedMessages == ClientSettings.Count)
{
Console.WriteLine("Factorial of {0} is: {1}", FactorialClientSettings.Count, msg);
ctx.CloseAsync();
ctx.CloseAsync().ContinueWith(t => this.answer.Add(msg));
}
}
private void SendNumbers()
void SendNumbers()
{
for (int i = 0; i < 4096 && next <= FactorialClientSettings.Count; i++)
for (int i = 0; (i < 4096) && (this.next <= ClientSettings.Count); i++)
{
ctx.WriteAsync(new BigInteger(next));
next++;
this.ctx.WriteAsync(new BigInteger(this.next));
this.next++;
}
ctx.Flush();
this.ctx.Flush();
}
}
}
}

Просмотреть файл

@ -1,24 +0,0 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace Factorial.Client
{
using System.Configuration;
using System.Net;
public static class FactorialClientSettings
{
public static bool IsSsl
{
get
{
string ssl = System.Configuration.ConfigurationManager.AppSettings["ssl"];
return !string.IsNullOrEmpty(ssl) && bool.Parse(ssl);
}
}
public static IPAddress Host => IPAddress.Parse(ConfigurationManager.AppSettings["host"]);
public static int Port => int.Parse(ConfigurationManager.AppSettings["port"]);
public static int Count => int.Parse(ConfigurationManager.AppSettings["count"]);
}
}

Просмотреть файл

@ -4,33 +4,31 @@
namespace Factorial.Client
{
using System;
using System.Diagnostics.Tracing;
using System.IO;
using System.Net;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
using System.Threading.Tasks;
using DotNetty.Common.Internal.Logging;
using DotNetty.Handlers.Logging;
using DotNetty.Handlers.Tls;
using DotNetty.Transport.Bootstrapping;
using DotNetty.Transport.Channels;
using DotNetty.Transport.Channels.Sockets;
using Microsoft.Practices.EnterpriseLibrary.SemanticLogging;
using Examples.Common;
class Program
{
static async Task RunClientAsync()
{
var eventListener = new ObservableEventListener();
eventListener.LogToConsole();
eventListener.EnableEvents(DefaultEventSource.Log, EventLevel.Verbose);
ExampleHelper.SetConsoleLogger();
var group = new MultithreadEventLoopGroup();
X509Certificate2 cert = null;
string targetHost = null;
if (FactorialClientSettings.IsSsl)
if (Examples.Common.ClientSettings.IsSsl)
{
cert = new X509Certificate2("dotnetty.com.pfx", "password");
cert = new X509Certificate2(Path.Combine(ExampleHelper.ProcessDirectory, "shared\\dotnetty.com.pfx"), "password");
targetHost = cert.GetNameInfo(X509NameType.DnsName, false);
}
try
@ -49,12 +47,19 @@ namespace Factorial.Client
pipeline.AddLast(new TlsHandler(stream => new SslStream(stream, true, (sender, certificate, chain, errors) => true), new ClientTlsSettings(targetHost)));
}
pipeline.AddLast(new Factorial.BigIntegerDecoder());
pipeline.AddLast(new Factorial.NumberEncoder());
pipeline.AddLast(new LoggingHandler("CONN"));
pipeline.AddLast(new BigIntegerDecoder());
pipeline.AddLast(new NumberEncoder());
pipeline.AddLast(new FactorialClientHandler());
}));
IChannel bootstrapChannel = await bootstrap.ConnectAsync(new IPEndPoint(FactorialClientSettings.Host, FactorialClientSettings.Port));
IChannel bootstrapChannel = await bootstrap.ConnectAsync(new IPEndPoint(Examples.Common.ClientSettings.Host, Examples.Common.ClientSettings.Port));
// Get the handler instance to retrieve the answer.
var handler = (FactorialClientHandler)bootstrapChannel.Pipeline.Last();
// Print out the answer.
Console.WriteLine("Factorial of {0} is: {1}", ClientSettings.Count.ToString(), handler.GetFactorial().ToString());
Console.ReadLine();
@ -63,10 +68,9 @@ namespace Factorial.Client
finally
{
group.ShutdownGracefullyAsync().Wait(1000);
eventListener.Dispose();
}
}
static void Main() => RunClientAsync().Wait();
public static void Main() => RunClientAsync().Wait();
}
}

Просмотреть файл

@ -0,0 +1,7 @@
{
"ssl": "true",
"host": "127.0.0.1",
"port": "8007",
"size": "256",
"count": "100"
}

Просмотреть файл

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="EnterpriseLibrary.SemanticLogging" version="2.0.1406.1" targetFramework="net45" />
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net45" />
</packages>

Просмотреть файл

@ -0,0 +1,45 @@
{
"name": "Factorial.Client",
"description": "Example of Factorial Client",
"buildOptions": {
"emitEntryPoint": true,
"copyToOutput": {
"include": [ "appsettings.json", "..\\..\\shared\\dotnetty.com.pfx" ]
}
},
"dependencies": {
"DotNetty.Common": {
"target": "project"
},
"DotNetty.Buffers": {
"target": "project"
},
"DotNetty.Transport": {
"target": "project"
},
"DotNetty.Handlers": {
"target": "project"
},
"DotNetty.Codecs": {
"target": "project"
},
"Examples.Common": {
"target": "project"
},
"Factorial": {
"target": "project"
}
},
"frameworks": {
"netcoreapp1.0": {
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.0-*",
"type": "platform"
}
},
"imports": "dnxcore50"
},
"net451": {}
}
}

Просмотреть файл

@ -1,18 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<appSettings>
<add key="ssl" value="True" />
<add key="port" value="8007" />
</appSettings>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

Просмотреть файл

@ -1,101 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{CAA57BA8-D7F2-467E-8F6F-5BA5B55A2F0B}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Factorial.Server</RootNamespace>
<AssemblyName>Factorial.Server</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Practices.EnterpriseLibrary.SemanticLogging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\packages\EnterpriseLibrary.SemanticLogging.2.0.1406.1\lib\net45\Microsoft.Practices.EnterpriseLibrary.SemanticLogging.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Numerics" />
</ItemGroup>
<ItemGroup>
<Compile Include="FactorialServerHandler.cs" />
<Compile Include="FactorialSettings.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="..\..\shared\dotnetty.com.pfx">
<Link>dotnetty.com.pfx</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<None Include="App.config" />
<None Include="packages.config">
<SubType>
</SubType>
</None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\DotNetty.Buffers\DotNetty.Buffers.csproj">
<Project>{5de3c557-48bf-4cdb-9f47-474d343dd841}</Project>
<Name>DotNetty.Buffers</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\DotNetty.Codecs\DotNetty.Codecs.csproj">
<Project>{2abd244e-ef8f-460d-9c30-39116499e6e4}</Project>
<Name>DotNetty.Codecs</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\DotNetty.Common\DotNetty.Common.csproj">
<Project>{de58fe41-5e99-44e5-86bc-fc9ed8761daf}</Project>
<Name>DotNetty.Common</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\DotNetty.Handlers\DotNetty.Handlers.csproj">
<Project>{09628314-f44e-445e-9f0d-cbe33b736ac3}</Project>
<Name>DotNetty.Handlers</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\DotNetty.Transport\DotNetty.Transport.csproj">
<Project>{8218c9ee-0a4a-432f-a12a-b54202f97b05}</Project>
<Name>DotNetty.Transport</Name>
</ProjectReference>
<ProjectReference Include="..\Factorial\Factorial.csproj">
<Project>{c7559bfc-023f-445e-bab8-e2b5e199b774}</Project>
<Name>Factorial</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

Просмотреть файл

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>caa57ba8-d7f2-467e-8f6f-5ba5b55a2f0b</ProjectGuid>
<RootNamespace>Factorial.Server</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>

Просмотреть файл

@ -9,24 +9,18 @@ namespace Factorial.Server
public class FactorialServerHandler : SimpleChannelInboundHandler<BigInteger>
{
private BigInteger lastMultiplier = new BigInteger(1);
private BigInteger factorial = new BigInteger(1);
BigInteger lastMultiplier = new BigInteger(1);
BigInteger factorial = new BigInteger(1);
protected override void ChannelRead0(IChannelHandlerContext ctx, BigInteger msg)
{
this.lastMultiplier = msg;
this.factorial *= msg;
ctx.WriteAndFlushAsync(factorial);
ctx.WriteAndFlushAsync(this.factorial);
}
public override void ChannelInactive(IChannelHandlerContext ctx)
{
System.Console.WriteLine("Factorial of {0} is: {1}", lastMultiplier, factorial);
}
public override void ChannelInactive(IChannelHandlerContext ctx) => Console.WriteLine("Factorial of {0} is: {1}", this.lastMultiplier, this.factorial);
public override void ExceptionCaught(IChannelHandlerContext ctx, Exception e)
{
ctx.CloseAsync();
}
public override void ExceptionCaught(IChannelHandlerContext ctx, Exception e) => ctx.CloseAsync();
}
}
}

Просмотреть файл

@ -1,21 +0,0 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace Factorial.Server
{
using System.Configuration;
public static class FactorialSettings
{
public static bool IsSsl
{
get
{
string ssl = System.Configuration.ConfigurationManager.AppSettings["ssl"];
return !string.IsNullOrEmpty(ssl) && bool.Parse(ssl);
}
}
public static int Port => int.Parse(ConfigurationManager.AppSettings["port"]);
}
}

Просмотреть файл

@ -4,31 +4,28 @@
namespace Factorial.Server
{
using System;
using System.Diagnostics.Tracing;
using System.IO;
using System.Security.Cryptography.X509Certificates;
using System.Threading.Tasks;
using DotNetty.Common.Internal.Logging;
using DotNetty.Handlers.Logging;
using DotNetty.Handlers.Tls;
using DotNetty.Transport.Bootstrapping;
using DotNetty.Transport.Channels;
using DotNetty.Transport.Channels.Sockets;
using Microsoft.Practices.EnterpriseLibrary.SemanticLogging;
using Examples.Common;
class Program
{
static async Task RunServerAsync()
{
var eventListener = new ObservableEventListener();
eventListener.LogToConsole();
eventListener.EnableEvents(DefaultEventSource.Log, EventLevel.LogAlways);
ExampleHelper.SetConsoleLogger();
var bossGroup = new MultithreadEventLoopGroup(1);
var workerGroup = new MultithreadEventLoopGroup();
X509Certificate2 tlsCertificate = null;
if (FactorialSettings.IsSsl)
if (ServerSettings.IsSsl)
{
tlsCertificate = new X509Certificate2("dotnetty.com.pfx", "password");
tlsCertificate = new X509Certificate2(Path.Combine(ExampleHelper.ProcessDirectory, "shared\\dotnetty.com.pfx"), "password");
}
try
{
@ -37,7 +34,7 @@ namespace Factorial.Server
.Group(bossGroup, workerGroup)
.Channel<TcpServerSocketChannel>()
.Option(ChannelOption.SoBacklog, 100)
.Handler(new LoggingHandler(LogLevel.INFO))
.Handler(new LoggingHandler("LSTN"))
.ChildHandler(new ActionChannelInitializer<ISocketChannel>(channel =>
{
IChannelPipeline pipeline = channel.Pipeline;
@ -45,10 +42,11 @@ namespace Factorial.Server
{
pipeline.AddLast(TlsHandler.Server(tlsCertificate));
}
pipeline.AddLast(new Factorial.NumberEncoder(), new Factorial.BigIntegerDecoder(), new FactorialServerHandler());
pipeline.AddLast(new LoggingHandler("CONN"));
pipeline.AddLast(new NumberEncoder(), new BigIntegerDecoder(), new FactorialServerHandler());
}));
IChannel bootstrapChannel = await bootstrap.BindAsync(FactorialSettings.Port);
IChannel bootstrapChannel = await bootstrap.BindAsync(ServerSettings.Port);
Console.ReadLine();
@ -57,10 +55,9 @@ namespace Factorial.Server
finally
{
Task.WaitAll(bossGroup.ShutdownGracefullyAsync(), workerGroup.ShutdownGracefullyAsync());
eventListener.Dispose();
}
}
static void Main() => RunServerAsync().Wait();
public static void Main() => RunServerAsync().Wait();
}
}

Просмотреть файл

@ -0,0 +1,4 @@
{
"ssl": "true",
"port": "8007"
}

Просмотреть файл

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="EnterpriseLibrary.SemanticLogging" version="2.0.1406.1" targetFramework="net45" />
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net45" />
</packages>

Просмотреть файл

@ -0,0 +1,45 @@
{
"name": "Factorial.Server",
"description": "Example of Factorial Server",
"buildOptions": {
"emitEntryPoint": true,
"copyToOutput": {
"include": ["appsettings.json", "..\\..\\shared\\dotnetty.com.pfx"]
}
},
"dependencies": {
"DotNetty.Common": {
"target": "project"
},
"DotNetty.Buffers": {
"target": "project"
},
"DotNetty.Transport": {
"target": "project"
},
"DotNetty.Handlers": {
"target": "project"
},
"DotNetty.Codecs": {
"target": "project"
},
"Examples.Common": {
"target": "project"
},
"Factorial": {
"target": "project"
}
},
"frameworks": {
"netcoreapp1.0": {
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.0-*",
"type": "platform"
}
},
"imports": "dnxcore50"
},
"net451": {}
}
}

Просмотреть файл

@ -5,6 +5,7 @@ namespace Factorial
{
using System;
using System.Collections.Generic;
using System.Numerics;
using DotNetty.Buffers;
using DotNetty.Codecs;
using DotNetty.Transport.Channels;
@ -31,10 +32,10 @@ namespace Factorial
input.ResetReaderIndex();
return;
}
byte[] decoded = new byte[dataLength];
var decoded = new byte[dataLength];
input.ReadBytes(decoded);
output.Add(new System.Numerics.BigInteger(decoded));
output.Add(new BigInteger(decoded));
}
}
}
}

Просмотреть файл

@ -1,79 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{C7559BFC-023F-445E-BAB8-E2B5E199B774}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Factorial</RootNamespace>
<AssemblyName>Factorial</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Numerics" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="BigIntegerDecoder.cs" />
<Compile Include="NumberEncoder.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\DotNetty.Buffers\DotNetty.Buffers.csproj">
<Project>{5de3c557-48bf-4cdb-9f47-474d343dd841}</Project>
<Name>DotNetty.Buffers</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\DotNetty.Codecs\DotNetty.Codecs.csproj">
<Project>{2abd244e-ef8f-460d-9c30-39116499e6e4}</Project>
<Name>DotNetty.Codecs</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\DotNetty.Common\DotNetty.Common.csproj">
<Project>{de58fe41-5e99-44e5-86bc-fc9ed8761daf}</Project>
<Name>DotNetty.Common</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\DotNetty.Handlers\DotNetty.Handlers.csproj">
<Project>{09628314-f44e-445e-9f0d-cbe33b736ac3}</Project>
<Name>DotNetty.Handlers</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\DotNetty.Transport\DotNetty.Transport.csproj">
<Project>{8218c9ee-0a4a-432f-a12a-b54202f97b05}</Project>
<Name>DotNetty.Transport</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

Просмотреть файл

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>c7559bfc-023f-445e-bab8-e2b5e199b774</ProjectGuid>
<RootNamespace>Factorial</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>

Просмотреть файл

@ -9,9 +9,9 @@ namespace Factorial
using DotNetty.Codecs;
using DotNetty.Transport.Channels;
public class NumberEncoder : MessageToMessageEncoder<BigInteger>
public class NumberEncoder : MessageToMessageEncoder<System.Numerics.BigInteger>
{
protected override void Encode(IChannelHandlerContext context, BigInteger message, List<object> output)
protected override void Encode(IChannelHandlerContext context, System.Numerics.BigInteger message, List<object> output)
{
IByteBuffer buffer = context.Allocator.Buffer();
@ -25,4 +25,4 @@ namespace Factorial
output.Add(buffer);
}
}
}
}

Просмотреть файл

@ -0,0 +1,34 @@
{
"name": "Factorial",
"description": "Common routines for Factorial example",
"dependencies": {
"DotNetty.Common": {
"target": "project"
},
"DotNetty.Buffers": {
"target": "project"
},
"DotNetty.Transport": {
"target": "project"
},
"DotNetty.Codecs": {
"target": "project"
}
},
"frameworks": {
"netcoreapp1.0": {
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.0-*",
"type": "platform"
}
},
"imports": "dnxcore50"
},
"net451": {
"frameworkAssemblies": {
"System.Numerics": "4.0.0.0"
}
}
}
}

Просмотреть файл

@ -1,19 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<appSettings>
<add key="ssl" value="True" />
<add key="host" value="127.0.0.1" />
<add key="port" value="8008" />
</appSettings>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

Просмотреть файл

@ -4,34 +4,31 @@
namespace SecureChat.Client
{
using System;
using System.Diagnostics.Tracing;
using System.IO;
using System.Net;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
using System.Threading.Tasks;
using DotNetty.Codecs;
using DotNetty.Common.Internal.Logging;
using DotNetty.Handlers.Tls;
using DotNetty.Transport.Bootstrapping;
using DotNetty.Transport.Channels;
using DotNetty.Transport.Channels.Sockets;
using Microsoft.Practices.EnterpriseLibrary.SemanticLogging;
using Examples.Common;
class Program
{
static async Task RunClientAsync()
{
var eventListener = new ObservableEventListener();
eventListener.LogToConsole();
eventListener.EnableEvents(DefaultEventSource.Log, EventLevel.Verbose);
ExampleHelper.SetConsoleLogger();
var group = new MultithreadEventLoopGroup();
X509Certificate2 cert = null;
string targetHost = null;
if (SecureChatClientSettings.IsSsl)
if (ClientSettings.IsSsl)
{
cert = new X509Certificate2("dotnetty.com.pfx", "password");
cert = new X509Certificate2(Path.Combine(ExampleHelper.ProcessDirectory, "shared\\dotnetty.com.pfx"), "password");
targetHost = cert.GetNameInfo(X509NameType.DnsName, false);
}
try
@ -54,19 +51,24 @@ namespace SecureChat.Client
pipeline.AddLast(new StringEncoder(), new StringDecoder(), new SecureChatClientHandler());
}));
IChannel bootstrapChannel = await bootstrap.ConnectAsync(new IPEndPoint(SecureChatClientSettings.Host, SecureChatClientSettings.Port));
IChannel bootstrapChannel = await bootstrap.ConnectAsync(new IPEndPoint(ClientSettings.Host, ClientSettings.Port));
for (;;)
{
string line = Console.ReadLine();
if (String.IsNullOrEmpty(line))
if (string.IsNullOrEmpty(line))
{
continue;
}
try { await bootstrapChannel.WriteAndFlushAsync(line + "\r\n"); }
catch { }
if (line.ToLower() == "bye")
try
{
await bootstrapChannel.WriteAndFlushAsync(line + "\r\n");
}
catch
{
}
if (string.Equals(line, "bye", StringComparison.OrdinalIgnoreCase))
{
await bootstrapChannel.CloseAsync();
break;
@ -78,7 +80,6 @@ namespace SecureChat.Client
finally
{
group.ShutdownGracefullyAsync().Wait(1000);
eventListener.Dispose();
}
}

Просмотреть файл

@ -1,93 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{B6C42665-2A5B-4BFD-B5B9-965C31A383D3}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>SecureChat.Client</RootNamespace>
<AssemblyName>SecureChat.Client</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Practices.EnterpriseLibrary.SemanticLogging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\packages\EnterpriseLibrary.SemanticLogging.2.0.1406.1\lib\net45\Microsoft.Practices.EnterpriseLibrary.SemanticLogging.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SecureChatClientHandler.cs" />
<Compile Include="SecureChatClientSettings.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="..\..\shared\dotnetty.com.pfx">
<Link>dotnetty.com.pfx</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\DotNetty.Buffers\DotNetty.Buffers.csproj">
<Project>{5de3c557-48bf-4cdb-9f47-474d343dd841}</Project>
<Name>DotNetty.Buffers</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\DotNetty.Codecs\DotNetty.Codecs.csproj">
<Project>{2abd244e-ef8f-460d-9c30-39116499e6e4}</Project>
<Name>DotNetty.Codecs</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\DotNetty.Common\DotNetty.Common.csproj">
<Project>{de58fe41-5e99-44e5-86bc-fc9ed8761daf}</Project>
<Name>DotNetty.Common</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\DotNetty.Handlers\DotNetty.Handlers.csproj">
<Project>{09628314-f44e-445e-9f0d-cbe33b736ac3}</Project>
<Name>DotNetty.Handlers</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\DotNetty.Transport\DotNetty.Transport.csproj">
<Project>{8218c9ee-0a4a-432f-a12a-b54202f97b05}</Project>
<Name>DotNetty.Transport</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

Просмотреть файл

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>b6c42665-2a5b-4bfd-b5b9-965c31a383d3</ProjectGuid>
<RootNamespace>SecureChat.Client</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>

Просмотреть файл

@ -8,15 +8,12 @@ namespace SecureChat.Client
public class SecureChatClientHandler : SimpleChannelInboundHandler<string>
{
protected override void ChannelRead0(IChannelHandlerContext contex, string msg)
{
Console.WriteLine(msg);
}
protected override void ChannelRead0(IChannelHandlerContext contex, string msg) => Console.WriteLine(msg);
public override void ExceptionCaught(IChannelHandlerContext contex, Exception e)
{
Console.WriteLine(DateTime.Now.Millisecond);
Console.WriteLine("{0}", e.StackTrace);
Console.WriteLine(e.StackTrace);
contex.CloseAsync();
}
}

Просмотреть файл

@ -1,24 +0,0 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace SecureChat.Client
{
using System.Configuration;
using System.Net;
public static class SecureChatClientSettings
{
public static bool IsSsl
{
get
{
string ssl = System.Configuration.ConfigurationManager.AppSettings["ssl"];
return !string.IsNullOrEmpty(ssl) && bool.Parse(ssl);
}
}
public static IPAddress Host => IPAddress.Parse(ConfigurationManager.AppSettings["host"]);
public static int Port => int.Parse(ConfigurationManager.AppSettings["port"]);
public static int Count => int.Parse(ConfigurationManager.AppSettings["count"]);
}
}

Просмотреть файл

@ -0,0 +1,5 @@
{
"ssl": "true",
"host": "127.0.0.1",
"port": "8007"
}

Просмотреть файл

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="EnterpriseLibrary.SemanticLogging" version="2.0.1406.1" targetFramework="net45" />
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net45" />
</packages>

Просмотреть файл

@ -0,0 +1,42 @@
{
"name": "SecureChat.Client",
"description": "Example of Secure Chat client",
"buildOptions": {
"emitEntryPoint": true,
"copyToOutput": {
"include": [ "appsettings.json", "..\\..\\shared\\dotnetty.com.pfx" ]
}
},
"dependencies": {
"DotNetty.Common": {
"target": "project"
},
"DotNetty.Buffers": {
"target": "project"
},
"DotNetty.Transport": {
"target": "project"
},
"DotNetty.Handlers": {
"target": "project"
},
"DotNetty.Codecs": {
"target": "project"
},
"Examples.Common": {
"target": "project"
}
},
"frameworks": {
"netcoreapp1.0": {
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.0-*",
"type": "platform"
}
},
"imports": "dnxcore50"
},
"net451": {}
}
}

Просмотреть файл

@ -1,18 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<appSettings>
<add key="ssl" value="True" />
<add key="port" value="8008" />
</appSettings>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

Просмотреть файл

@ -4,25 +4,22 @@
namespace SecureChat.Server
{
using System;
using System.Diagnostics.Tracing;
using System.IO;
using System.Security.Cryptography.X509Certificates;
using System.Threading.Tasks;
using DotNetty.Codecs;
using DotNetty.Common.Internal.Logging;
using DotNetty.Handlers.Logging;
using DotNetty.Handlers.Tls;
using DotNetty.Transport.Bootstrapping;
using DotNetty.Transport.Channels;
using DotNetty.Transport.Channels.Sockets;
using Microsoft.Practices.EnterpriseLibrary.SemanticLogging;
using Examples.Common;
class Program
{
static async Task RunServerAsync()
{
var eventListener = new ObservableEventListener();
eventListener.LogToConsole();
eventListener.EnableEvents(DefaultEventSource.Log, EventLevel.LogAlways);
ExampleHelper.SetConsoleLogger();
var bossGroup = new MultithreadEventLoopGroup(1);
var workerGroup = new MultithreadEventLoopGroup();
@ -32,9 +29,9 @@ namespace SecureChat.Server
var SERVER_HANDLER = new SecureChatServerHandler();
X509Certificate2 tlsCertificate = null;
if (SecureChatSettings.IsSsl)
if (ServerSettings.IsSsl)
{
tlsCertificate = new X509Certificate2("dotnetty.com.pfx", "password");
tlsCertificate = new X509Certificate2(Path.Combine(ExampleHelper.ProcessDirectory, "shared\\dotnetty.com.pfx"), "password");
}
try
{
@ -56,7 +53,7 @@ namespace SecureChat.Server
pipeline.AddLast(STRING_ENCODER, STRING_DECODER, SERVER_HANDLER);
}));
IChannel bootstrapChannel = await bootstrap.BindAsync(SecureChatSettings.Port);
IChannel bootstrapChannel = await bootstrap.BindAsync(ServerSettings.Port);
Console.ReadLine();
@ -65,7 +62,6 @@ namespace SecureChat.Server
finally
{
Task.WaitAll(bossGroup.ShutdownGracefullyAsync(), workerGroup.ShutdownGracefullyAsync());
eventListener.Dispose();
}
}

Просмотреть файл

@ -1,93 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{DDA47BCE-752F-4DEE-BB75-28E7D6921E79}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>SecureChat.Server</RootNamespace>
<AssemblyName>SecureChat.Server</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Practices.EnterpriseLibrary.SemanticLogging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\packages\EnterpriseLibrary.SemanticLogging.2.0.1406.1\lib\net45\Microsoft.Practices.EnterpriseLibrary.SemanticLogging.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SecureChatServerHandler.cs" />
<Compile Include="SecureChatSettings.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="..\..\shared\dotnetty.com.pfx">
<Link>dotnetty.com.pfx</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\DotNetty.Buffers\DotNetty.Buffers.csproj">
<Project>{5de3c557-48bf-4cdb-9f47-474d343dd841}</Project>
<Name>DotNetty.Buffers</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\DotNetty.Codecs\DotNetty.Codecs.csproj">
<Project>{2abd244e-ef8f-460d-9c30-39116499e6e4}</Project>
<Name>DotNetty.Codecs</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\DotNetty.Common\DotNetty.Common.csproj">
<Project>{de58fe41-5e99-44e5-86bc-fc9ed8761daf}</Project>
<Name>DotNetty.Common</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\DotNetty.Handlers\DotNetty.Handlers.csproj">
<Project>{09628314-f44e-445e-9f0d-cbe33b736ac3}</Project>
<Name>DotNetty.Handlers</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\DotNetty.Transport\DotNetty.Transport.csproj">
<Project>{8218c9ee-0a4a-432f-a12a-b54202f97b05}</Project>
<Name>DotNetty.Transport</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

Просмотреть файл

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>dda47bce-752f-4dee-bb75-28e7d6921e79</ProjectGuid>
<RootNamespace>SecureChat.Server</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>

Просмотреть файл

@ -5,66 +5,65 @@ namespace SecureChat.Server
{
using System;
using System.Net;
using DotNetty.Transport.Channels.Groups;
using DotNetty.Transport.Channels;
using DotNetty.Transport.Channels.Groups;
public class SecureChatServerHandler : SimpleChannelInboundHandler<String>
public class SecureChatServerHandler : SimpleChannelInboundHandler<string>
{
static IChannelGroup group = null;
static volatile IChannelGroup group;
public override void ChannelActive(IChannelHandlerContext contex)
{
lock (this)
IChannelGroup g = group;
if (g == null)
{
if (group == null)
lock (this)
{
group = new DefaultChannelGroup(contex.Executor);
if (group == null)
{
g = group = new DefaultChannelGroup(contex.Executor);
}
}
}
contex.WriteAndFlushAsync(String.Format("Welcome to {0} secure chat server!\n", Dns.GetHostName()));
group.Add(contex.Channel);
contex.WriteAndFlushAsync(string.Format("Welcome to {0} secure chat server!\n", Dns.GetHostName()));
g.Add(contex.Channel);
}
class EveryOneBut : IChannelMatcher
{
IChannelId id;
readonly IChannelId id;
public EveryOneBut(IChannelId id)
{
this.id = id;
}
public bool Matches(IChannel channel)
{
return channel.Id != this.id;
}
public bool Matches(IChannel channel) => channel.Id != this.id;
}
protected override void ChannelRead0(IChannelHandlerContext contex, string msg)
{
//send message to all but this one
string broadcast = String.Format("[{0}] {1}\n", contex.Channel.RemoteAddress, msg);
string response = String.Format("[you] {0}\n", msg);
string broadcast = string.Format("[{0}] {1}\n", contex.Channel.RemoteAddress, msg);
string response = string.Format("[you] {0}\n", msg);
group.WriteAndFlushAsync(broadcast, new EveryOneBut(contex.Channel.Id));
contex.WriteAndFlushAsync(response);
if ("bye" == msg.ToLower())
if (string.Equals("bye", msg, StringComparison.OrdinalIgnoreCase))
{
contex.CloseAsync();
}
}
public override void ChannelReadComplete(IChannelHandlerContext contex)
{
contex.Flush();
}
public override void ChannelReadComplete(IChannelHandlerContext ctx) => ctx.Flush();
public override void ExceptionCaught(IChannelHandlerContext contex, Exception e)
public override void ExceptionCaught(IChannelHandlerContext ctx, Exception e)
{
Console.WriteLine("{0}", e.StackTrace);
contex.CloseAsync();
ctx.CloseAsync();
}
public override bool IsSharable => true;
}
}
}

Просмотреть файл

@ -1,21 +0,0 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace SecureChat.Server
{
using System.Configuration;
public static class SecureChatSettings
{
public static bool IsSsl
{
get
{
string ssl = System.Configuration.ConfigurationManager.AppSettings["ssl"];
return !string.IsNullOrEmpty(ssl) && bool.Parse(ssl);
}
}
public static int Port => int.Parse(ConfigurationManager.AppSettings["port"]);
}
}

Просмотреть файл

@ -0,0 +1,4 @@
{
"ssl": "true",
"port": "8007"
}

Просмотреть файл

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="EnterpriseLibrary.SemanticLogging" version="2.0.1406.1" targetFramework="net45" />
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net45" />
</packages>

Просмотреть файл

@ -0,0 +1,42 @@
{
"name": "SecureChat.Server",
"description": "Example of Secure Chat Server",
"buildOptions": {
"emitEntryPoint": true,
"copyToOutput": {
"include": ["appsettings.json", "..\\..\\shared\\dotnetty.com.pfx"]
}
},
"dependencies": {
"DotNetty.Common": {
"target": "project"
},
"DotNetty.Buffers": {
"target": "project"
},
"DotNetty.Transport": {
"target": "project"
},
"DotNetty.Handlers": {
"target": "project"
},
"DotNetty.Codecs": {
"target": "project"
},
"Examples.Common": {
"target": "project"
}
},
"frameworks": {
"netcoreapp1.0": {
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.0-*",
"type": "platform"
}
},
"imports": "dnxcore50"
},
"net451": {}
}
}

Просмотреть файл

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<appSettings>
<add key="ssl" value="True" />
<add key="host" value="127.0.0.1" />
<add key="port" value="8007" />
<add key="count" value="100"/>
</appSettings>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

Просмотреть файл

@ -4,34 +4,31 @@
namespace Telnet.Client
{
using System;
using System.Diagnostics.Tracing;
using System.IO;
using System.Net;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
using System.Threading.Tasks;
using DotNetty.Codecs;
using DotNetty.Common.Internal.Logging;
using DotNetty.Handlers.Tls;
using DotNetty.Transport.Bootstrapping;
using DotNetty.Transport.Channels;
using DotNetty.Transport.Channels.Sockets;
using Microsoft.Practices.EnterpriseLibrary.SemanticLogging;
using Examples.Common;
class Program
{
static async Task RunClientAsync()
{
var eventListener = new ObservableEventListener();
eventListener.LogToConsole();
eventListener.EnableEvents(DefaultEventSource.Log, EventLevel.Verbose);
ExampleHelper.SetConsoleLogger();
var group = new MultithreadEventLoopGroup();
X509Certificate2 cert = null;
string targetHost = null;
if (TelnetClientSettings.IsSsl)
if (ClientSettings.IsSsl)
{
cert = new X509Certificate2("dotnetty.com.pfx", "password");
cert = new X509Certificate2(Path.Combine(ExampleHelper.ProcessDirectory, "shared\\dotnetty.com.pfx"), "password");
targetHost = cert.GetNameInfo(X509NameType.DnsName, false);
}
try
@ -54,19 +51,24 @@ namespace Telnet.Client
pipeline.AddLast(new StringEncoder(), new StringDecoder(), new TelnetClientHandler());
}));
IChannel bootstrapChannel = await bootstrap.ConnectAsync(new IPEndPoint(TelnetClientSettings.Host, TelnetClientSettings.Port));
IChannel bootstrapChannel = await bootstrap.ConnectAsync(new IPEndPoint(ClientSettings.Host, ClientSettings.Port));
for (;;)
{
string line = Console.ReadLine();
if (String.IsNullOrEmpty(line))
if (string.IsNullOrEmpty(line))
{
continue;
}
try { await bootstrapChannel.WriteAndFlushAsync(line + "\r\n"); }
catch { }
if (line.ToLower() == "bye")
try
{
await bootstrapChannel.WriteAndFlushAsync(line + "\r\n");
}
catch
{
}
if (string.Equals(line, "bye", StringComparison.OrdinalIgnoreCase))
{
await bootstrapChannel.CloseAsync();
break;
@ -78,7 +80,6 @@ namespace Telnet.Client
finally
{
group.ShutdownGracefullyAsync().Wait(1000);
eventListener.Dispose();
}
}

Просмотреть файл

@ -1,93 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{ABABFE48-551E-4C4B-8640-B334329D5C5D}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Telnet.Client</RootNamespace>
<AssemblyName>Telnet.Client</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Practices.EnterpriseLibrary.SemanticLogging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\packages\EnterpriseLibrary.SemanticLogging.2.0.1406.1\lib\net45\Microsoft.Practices.EnterpriseLibrary.SemanticLogging.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
</ItemGroup>
<ItemGroup>
<Compile Include="TelnetClientHandler.cs" />
<Compile Include="TelnetClientSettings.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="..\..\shared\dotnetty.com.pfx">
<Link>dotnetty.com.pfx</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\DotNetty.Buffers\DotNetty.Buffers.csproj">
<Project>{5de3c557-48bf-4cdb-9f47-474d343dd841}</Project>
<Name>DotNetty.Buffers</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\DotNetty.Codecs\DotNetty.Codecs.csproj">
<Project>{2abd244e-ef8f-460d-9c30-39116499e6e4}</Project>
<Name>DotNetty.Codecs</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\DotNetty.Common\DotNetty.Common.csproj">
<Project>{de58fe41-5e99-44e5-86bc-fc9ed8761daf}</Project>
<Name>DotNetty.Common</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\DotNetty.Handlers\DotNetty.Handlers.csproj">
<Project>{09628314-f44e-445e-9f0d-cbe33b736ac3}</Project>
<Name>DotNetty.Handlers</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\DotNetty.Transport\DotNetty.Transport.csproj">
<Project>{8218c9ee-0a4a-432f-a12a-b54202f97b05}</Project>
<Name>DotNetty.Transport</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

Просмотреть файл

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>ababfe48-551e-4c4b-8640-b334329d5c5d</ProjectGuid>
<RootNamespace>Telnet.Client</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>

Просмотреть файл

@ -1,24 +0,0 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace Telnet.Client
{
using System.Configuration;
using System.Net;
public static class TelnetClientSettings
{
public static bool IsSsl
{
get
{
string ssl = System.Configuration.ConfigurationManager.AppSettings["ssl"];
return !string.IsNullOrEmpty(ssl) && bool.Parse(ssl);
}
}
public static IPAddress Host => IPAddress.Parse(ConfigurationManager.AppSettings["host"]);
public static int Port => int.Parse(ConfigurationManager.AppSettings["port"]);
public static int Count => int.Parse(ConfigurationManager.AppSettings["count"]);
}
}

Просмотреть файл

@ -0,0 +1,6 @@
{
"ssl": "true",
"host": "127.0.0.1",
"port": "8007",
"size": "256"
}

Просмотреть файл

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="EnterpriseLibrary.SemanticLogging" version="2.0.1406.1" targetFramework="net452" />
<package id="Newtonsoft.Json" version="5.0.8" targetFramework="net452" />
</packages>

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше