Skip to content

Commit 18f1f8d

Browse files
committed
initial commit - added console applications - demo-server and demo-client
1 parent 13099ce commit 18f1f8d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+29869
-108
lines changed

Diff for: .gitignore

+4-107
Original file line numberDiff line numberDiff line change
@@ -1,108 +1,5 @@
1-
# Build Folders (you can keep bin if you'd like, to store dlls and pdbs)
2-
[Bb]in/
3-
[Oo]bj/
4-
5-
# mstest test results
6-
TestResults
7-
8-
## Ignore Visual Studio temporary files, build results, and
9-
## files generated by popular Visual Studio add-ons.
10-
11-
# User-specific files
1+
bin
2+
obj
123
*.suo
13-
*.user
14-
*.sln.docstates
15-
16-
# Build results
17-
[Dd]ebug/
18-
[Rr]elease/
19-
x64/
20-
*_i.c
21-
*_p.c
22-
*.ilk
23-
*.meta
24-
*.obj
25-
*.pch
26-
*.pdb
27-
*.pgc
28-
*.pgd
29-
*.rsp
30-
*.sbr
31-
*.tlb
32-
*.tli
33-
*.tlh
34-
*.tmp
35-
*.log
36-
*.vspscc
37-
*.vssscc
38-
.builds
39-
40-
# Visual C++ cache files
41-
ipch/
42-
*.aps
43-
*.ncb
44-
*.opensdf
45-
*.sdf
46-
47-
# Visual Studio profiler
48-
*.psess
49-
*.vsp
50-
*.vspx
51-
52-
# Guidance Automation Toolkit
53-
*.gpState
54-
55-
# ReSharper is a .NET coding add-in
56-
_ReSharper*
57-
58-
# NCrunch
59-
*.ncrunch*
60-
.*crunch*.local.xml
61-
62-
# Installshield output folder
63-
[Ee]xpress
64-
65-
# DocProject is a documentation generator add-in
66-
DocProject/buildhelp/
67-
DocProject/Help/*.HxT
68-
DocProject/Help/*.HxC
69-
DocProject/Help/*.hhc
70-
DocProject/Help/*.hhk
71-
DocProject/Help/*.hhp
72-
DocProject/Help/Html2
73-
DocProject/Help/html
74-
75-
# Click-Once directory
76-
publish
77-
78-
# Publish Web Output
79-
*.Publish.xml
80-
81-
# NuGet Packages Directory
82-
packages
83-
84-
# Windows Azure Build Output
85-
csx
86-
*.build.csdef
87-
88-
# Windows Store app package directory
89-
AppPackages/
90-
91-
# Others
92-
[Bb]in
93-
[Oo]bj
94-
sql
95-
TestResults
96-
[Tt]est[Rr]esult*
97-
*.Cache
98-
ClientBin
99-
[Ss]tyle[Cc]op.*
100-
~$*
101-
*.dbmdl
102-
Generated_Code #added for RIA/Silverlight projects
103-
104-
# Backup & report files from converting an old project file to a newer
105-
# Visual Studio version. Backup files are not needed, because we have git ;-)
106-
_UpgradeReport_Files/
107-
Backup*/
108-
UpgradeLog*.XML
4+
*.DotSettings.user
5+
*_ReSharper*

Diff for: ClientApplication/ClientApplication.csproj

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{6EFAF2E0-EA89-490E-940C-6803A1CF8AD7}</ProjectGuid>
8+
<OutputType>Exe</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>Dem0n13.ClientApplication</RootNamespace>
11+
<AssemblyName>Dem0n13.ClientApplication</AssemblyName>
12+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
13+
<FileAlignment>512</FileAlignment>
14+
</PropertyGroup>
15+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
16+
<PlatformTarget>AnyCPU</PlatformTarget>
17+
<DebugSymbols>true</DebugSymbols>
18+
<DebugType>full</DebugType>
19+
<Optimize>false</Optimize>
20+
<OutputPath>bin\Debug\</OutputPath>
21+
<DefineConstants>DEBUG;TRACE</DefineConstants>
22+
<ErrorReport>prompt</ErrorReport>
23+
<WarningLevel>4</WarningLevel>
24+
</PropertyGroup>
25+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
26+
<PlatformTarget>AnyCPU</PlatformTarget>
27+
<DebugType>pdbonly</DebugType>
28+
<Optimize>true</Optimize>
29+
<OutputPath>bin\Release\</OutputPath>
30+
<DefineConstants>TRACE</DefineConstants>
31+
<ErrorReport>prompt</ErrorReport>
32+
<WarningLevel>4</WarningLevel>
33+
</PropertyGroup>
34+
<ItemGroup>
35+
<Reference Include="System" />
36+
<Reference Include="System.Core" />
37+
</ItemGroup>
38+
<ItemGroup>
39+
<Compile Include="ConsoleApplication.cs" />
40+
<Compile Include="Properties\AssemblyInfo.cs" />
41+
</ItemGroup>
42+
<ItemGroup>
43+
<Content Include="NLog.config">
44+
<SubType>Designer</SubType>
45+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
46+
</Content>
47+
</ItemGroup>
48+
<ItemGroup>
49+
<ProjectReference Include="..\UdpSocketServer\UdpSocketServer.csproj">
50+
<Project>{3f2c57d0-c2ec-4576-8914-1bf65a398f3d}</Project>
51+
<Name>UdpSocketServer</Name>
52+
</ProjectReference>
53+
<ProjectReference Include="..\Utils\Utils.csproj">
54+
<Project>{384E5588-F3BA-4DEC-B7F5-7E78BB2739A4}</Project>
55+
<Name>Utils</Name>
56+
</ProjectReference>
57+
</ItemGroup>
58+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
59+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
60+
Other similar extension points exist, see Microsoft.Common.targets.
61+
<Target Name="BeforeBuild">
62+
</Target>
63+
<Target Name="AfterBuild">
64+
</Target>
65+
-->
66+
</Project>

Diff for: ClientApplication/ConsoleApplication.cs

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
using System;
2+
using System.Net;
3+
using System.Net.Sockets;
4+
using Dem0n13.SocketServer;
5+
6+
namespace Dem0n13.ClientApplication
7+
{
8+
internal class ConsoleApplication
9+
{
10+
private const int ServerPort = 50000;
11+
private const int BufferSize = 1024;
12+
13+
static void Main()
14+
{
15+
var serverAddres = IPAddress.Loopback;
16+
var serverEndPoint = new IPEndPoint(serverAddres, ServerPort);
17+
EndPoint emptyEndPoint = new IPEndPoint(IPAddress.None, ServerPort);
18+
19+
var client = new UdpClientArgs(BufferSize);
20+
client.Socket.ReceiveTimeout = 500;
21+
Console.WriteLine("Enter the message for server");
22+
23+
string request;
24+
do
25+
{
26+
Console.Write("> ");
27+
request = Console.ReadLine();
28+
client.UTF8Message = request;
29+
client.Socket.SendTo(client.DataBuffer, serverEndPoint);
30+
try
31+
{
32+
client.Socket.ReceiveFrom(client.DataBuffer, ref emptyEndPoint);
33+
Console.WriteLine("< " + client.UTF8Message);
34+
}
35+
catch (SocketException ex)
36+
{
37+
Console.WriteLine("Error: " + ex.SocketErrorCode);
38+
}
39+
} while (!string.IsNullOrEmpty(request));
40+
}
41+
}
42+
}

Diff for: ClientApplication/NLog.config

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
autoReload="true">
5+
<targets>
6+
<target xsi:type="Debugger" name="debug"/>
7+
<target xsi:type="ColoredConsole" name="coloredConsole"/>
8+
</targets>
9+
<rules>
10+
<logger name="SocketServer" writeTo="debug" level="Trace" />
11+
<logger name="*" writeTo="coloredConsole" minlevel="Info" />
12+
</rules>
13+
</nlog>

Diff for: ClientApplication/Properties/AssemblyInfo.cs

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// Управление общими сведениями о сборке осуществляется с помощью
6+
// набора атрибутов. Измените значения этих атрибутов, чтобы изменить сведения,
7+
// связанные со сборкой.
8+
[assembly: AssemblyTitle("ClientApplication")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("")]
12+
[assembly: AssemblyProduct("ClientApplication")]
13+
[assembly: AssemblyCopyright("Copyright © 2013")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Параметр ComVisible со значением FALSE делает типы в сборке невидимыми
18+
// для COM-компонентов. Если требуется обратиться к типу в этой сборке через
19+
// COM, задайте атрибуту ComVisible значение TRUE для этого типа.
20+
[assembly: ComVisible(false)]
21+
22+
// Следующий GUID служит для идентификации библиотеки типов, если этот проект будет видимым для COM
23+
[assembly: Guid("4dda6c66-b30b-4d9e-8ad3-b402f500e4f4")]
24+
25+
// Сведения о версии сборки состоят из следующих четырех значений:
26+
//
27+
// Основной номер версии
28+
// Дополнительный номер версии
29+
// Номер построения
30+
// Редакция
31+
//
32+
// Можно задать все значения или принять номер построения и номер редакции по умолчанию,
33+
// используя "*", как показано ниже:
34+
// [assembly: AssemblyVersion("1.0.*")]
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]

Diff for: EvolutionServer.sln

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 2012
4+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SocketServer", "SocketServer\SocketServer.csproj", "{A4B040D2-D5BC-485A-88F8-15493BCE5872}"
5+
EndProject
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ServerApplication", "Application\ServerApplication.csproj", "{AE53B4AA-FFE0-404F-A761-E59E7847DB5C}"
7+
EndProject
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TcpSocketServer", "TcpSocketServer\TcpSocketServer.csproj", "{37777C7C-4F76-46AA-B2DB-8C3677D22E74}"
9+
EndProject
10+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "Tests\Tests.csproj", "{4959C521-6FEF-465F-BAEF-F71B99EE0477}"
11+
EndProject
12+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UdpSocketServer", "UdpSocketServer\UdpSocketServer.csproj", "{3F2C57D0-C2EC-4576-8914-1BF65A398F3D}"
13+
EndProject
14+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClientApplication", "ClientApplication\ClientApplication.csproj", "{6EFAF2E0-EA89-490E-940C-6803A1CF8AD7}"
15+
EndProject
16+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Utils", "Utils\Utils.csproj", "{384E5588-F3BA-4DEC-B7F5-7E78BB2739A4}"
17+
EndProject
18+
Global
19+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
20+
Debug|Any CPU = Debug|Any CPU
21+
Release|Any CPU = Release|Any CPU
22+
EndGlobalSection
23+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
24+
{A4B040D2-D5BC-485A-88F8-15493BCE5872}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
25+
{A4B040D2-D5BC-485A-88F8-15493BCE5872}.Debug|Any CPU.Build.0 = Debug|Any CPU
26+
{A4B040D2-D5BC-485A-88F8-15493BCE5872}.Release|Any CPU.ActiveCfg = Release|Any CPU
27+
{A4B040D2-D5BC-485A-88F8-15493BCE5872}.Release|Any CPU.Build.0 = Release|Any CPU
28+
{AE53B4AA-FFE0-404F-A761-E59E7847DB5C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
29+
{AE53B4AA-FFE0-404F-A761-E59E7847DB5C}.Debug|Any CPU.Build.0 = Debug|Any CPU
30+
{AE53B4AA-FFE0-404F-A761-E59E7847DB5C}.Release|Any CPU.ActiveCfg = Release|Any CPU
31+
{AE53B4AA-FFE0-404F-A761-E59E7847DB5C}.Release|Any CPU.Build.0 = Release|Any CPU
32+
{37777C7C-4F76-46AA-B2DB-8C3677D22E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
33+
{37777C7C-4F76-46AA-B2DB-8C3677D22E74}.Debug|Any CPU.Build.0 = Debug|Any CPU
34+
{37777C7C-4F76-46AA-B2DB-8C3677D22E74}.Release|Any CPU.ActiveCfg = Release|Any CPU
35+
{37777C7C-4F76-46AA-B2DB-8C3677D22E74}.Release|Any CPU.Build.0 = Release|Any CPU
36+
{4959C521-6FEF-465F-BAEF-F71B99EE0477}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
37+
{4959C521-6FEF-465F-BAEF-F71B99EE0477}.Debug|Any CPU.Build.0 = Debug|Any CPU
38+
{4959C521-6FEF-465F-BAEF-F71B99EE0477}.Release|Any CPU.ActiveCfg = Release|Any CPU
39+
{4959C521-6FEF-465F-BAEF-F71B99EE0477}.Release|Any CPU.Build.0 = Release|Any CPU
40+
{3F2C57D0-C2EC-4576-8914-1BF65A398F3D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
41+
{3F2C57D0-C2EC-4576-8914-1BF65A398F3D}.Debug|Any CPU.Build.0 = Debug|Any CPU
42+
{3F2C57D0-C2EC-4576-8914-1BF65A398F3D}.Release|Any CPU.ActiveCfg = Release|Any CPU
43+
{3F2C57D0-C2EC-4576-8914-1BF65A398F3D}.Release|Any CPU.Build.0 = Release|Any CPU
44+
{6EFAF2E0-EA89-490E-940C-6803A1CF8AD7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
45+
{6EFAF2E0-EA89-490E-940C-6803A1CF8AD7}.Debug|Any CPU.Build.0 = Debug|Any CPU
46+
{6EFAF2E0-EA89-490E-940C-6803A1CF8AD7}.Release|Any CPU.ActiveCfg = Release|Any CPU
47+
{6EFAF2E0-EA89-490E-940C-6803A1CF8AD7}.Release|Any CPU.Build.0 = Release|Any CPU
48+
{384E5588-F3BA-4DEC-B7F5-7E78BB2739A4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
49+
{384E5588-F3BA-4DEC-B7F5-7E78BB2739A4}.Debug|Any CPU.Build.0 = Debug|Any CPU
50+
{384E5588-F3BA-4DEC-B7F5-7E78BB2739A4}.Release|Any CPU.ActiveCfg = Release|Any CPU
51+
{384E5588-F3BA-4DEC-B7F5-7E78BB2739A4}.Release|Any CPU.Build.0 = Release|Any CPU
52+
EndGlobalSection
53+
GlobalSection(SolutionProperties) = preSolution
54+
HideSolutionNode = FALSE
55+
EndGlobalSection
56+
EndGlobal

Diff for: ExternalLibrary/NLog.dll

379 KB
Binary file not shown.

0 commit comments

Comments
 (0)