Added receivedata to a thread

This commit is contained in:
jancoow
2015-10-15 13:58:33 +02:00
parent eb5e1254b0
commit 78c86d5680
3 changed files with 4 additions and 12 deletions
-1
View File
@@ -4,7 +4,6 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MusicPlayer;
using Newtonsoft.Json;
namespace MusicPlayer
{
@@ -33,10 +33,6 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
@@ -62,9 +58,6 @@
<Compile Include="NetworkHandler.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
@@ -74,7 +67,6 @@
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
+4 -3
View File
@@ -1,5 +1,4 @@
using System;
using System.Text;
using System.Text;
using System.Net.Sockets;
using System.Threading;
@@ -15,8 +14,10 @@ namespace MusicPlayer
{
s = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
s.Connect(ip, port);
ThreadStart thread = new ThreadStart(ReceiveData);
Thread childThread = new Thread(thread);
childThread.Start();
api = apihandler;
SendString("GET");
}
public void SendString(string m)