some client server changes
This commit is contained in:
1 parent
a559a98640
commit
00199ec762
8 files changed
+44
-27
No files matched your search
@@ -70,15 +70,15 @@
|
||||
<Compile Include="..\ClientServerLib\DeffieHellman\StrongNumberProvider.cs">
|
||||
<Link>ClientServerLib\DeffieHellman\StrongNumberProvider.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\ClientServerLib\Vocaluxe\CCommands.cs">
|
||||
<Link>ClientServerLib\Vocaluxe\CCommands.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\ClientServerLib\Vocaluxe\VocaluxeStructs.cs">
|
||||
<Link>ClientServerLib\Vocaluxe\VocaluxeStructs.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\ClientServerLib\CDiscover.cs">
|
||||
<Link>ClientServerLib\CDiscover.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\Vocaluxe\Base\Server\CCommands.cs">
|
||||
<Link>ClientServerLib\Server\CCommands.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\Vocaluxe\Base\Server\VocaluxeStructs.cs">
|
||||
<Link>ClientServerLib\Server\VocaluxeStructs.cs</Link>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\AboutResources.txt" />
|
||||
@@ -93,5 +93,7 @@
|
||||
<ItemGroup>
|
||||
<Folder Include="ClientServerLib\" />
|
||||
<Folder Include="Assets\" />
|
||||
<Folder Include="ClientServerLib\Vocaluxe\" />
|
||||
<Folder Include="ClientServerLib\Server\" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -118,8 +118,8 @@ namespace ClientServerLib
|
||||
}
|
||||
catch
|
||||
{
|
||||
connected = false;
|
||||
RaiseOnConnectionChanged();
|
||||
DoDisconnect();
|
||||
|
||||
for (int i = 0; i < 500; i++)
|
||||
{
|
||||
if (doConnect)
|
||||
@@ -133,17 +133,7 @@ namespace ClientServerLib
|
||||
|
||||
if (connected && !doConnect)
|
||||
{
|
||||
try
|
||||
{
|
||||
connection.TcpClient.Close();
|
||||
connection = new CConnection(new TcpClient(), -1);
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
|
||||
connected = false;
|
||||
RaiseOnConnectionChanged();
|
||||
DoDisconnect();
|
||||
}
|
||||
|
||||
if (doConnect && connected)
|
||||
@@ -154,16 +144,31 @@ namespace ClientServerLib
|
||||
}
|
||||
catch
|
||||
{
|
||||
connected = false;
|
||||
RaiseOnConnectionChanged();
|
||||
DoDisconnect();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void DoDisconnect()
|
||||
{
|
||||
try
|
||||
{
|
||||
connection.TcpClient.Close();
|
||||
}
|
||||
catch { }
|
||||
|
||||
connection = new CConnection(new TcpClient(), -1);
|
||||
connected = false;
|
||||
RaiseOnConnectionChanged();
|
||||
}
|
||||
|
||||
private void Communicate()
|
||||
{
|
||||
if (connection.TcpClient == null || !connection.TcpClient.Connected)
|
||||
DoDisconnect();
|
||||
|
||||
NetworkStream clientStream = connection.TcpClient.GetStream();
|
||||
|
||||
byte[] data = new byte[bufferLength];
|
||||
|
||||
@@ -31,10 +31,6 @@
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>bin\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
@@ -53,8 +49,6 @@
|
||||
<Compile Include="DeffieHellman\StrongNumberProvider.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Structs.cs" />
|
||||
<Compile Include="Vocaluxe\CCommands.cs" />
|
||||
<Compile Include="Vocaluxe\VocaluxeStructs.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
|
||||
@@ -34,6 +34,10 @@
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\ClientServerLib\bin\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
@@ -46,6 +50,12 @@
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="..\..\Vocaluxe\Base\Server\CCommands.cs">
|
||||
<Link>CCommands.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\Vocaluxe\Base\Server\VocaluxeStructs.cs">
|
||||
<Link>VocaluxeStructs.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="ClientTest.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
|
||||
Binary file not shown.
File renamed without changes.
File renamed without changes.
@@ -159,6 +159,10 @@
|
||||
<Reference Include="Community.CsharpSqlite">
|
||||
<HintPath>..\Output\Community.CsharpSqlite.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\ClientServerLib\ClientServerLib\bin\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="OpenTK">
|
||||
<HintPath>..\Output\OpenTK.dll</HintPath>
|
||||
</Reference>
|
||||
@@ -203,7 +207,9 @@
|
||||
<Compile Include="Base\Fonts\CFonts.cs" />
|
||||
<Compile Include="Base\Fonts\CGlyph.cs" />
|
||||
<Compile Include="Base\Server\CClientHandler.cs" />
|
||||
<Compile Include="Base\Server\CCommands.cs" />
|
||||
<Compile Include="Base\Server\CVocaluxeServer.cs" />
|
||||
<Compile Include="Base\Server\VocaluxeStructs.cs" />
|
||||
<Compile Include="CSplashScreen.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
|
||||
Reference in new issue
Block a user