Explorar o código

Added receivedata to a thread

jancoow %!s(int64=10) %!d(string=hai) anos
pai
achega
78c86d5680

+ 0 - 1
MusicPlayer/MusicPlayer/APIHandler.cs

@@ -4,7 +4,6 @@ using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
 using MusicPlayer;
-using Newtonsoft.Json;
 
 namespace MusicPlayer
 {

+ 0 - 8
MusicPlayer/MusicPlayer/MusicPlayer.csproj

@@ -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
MusicPlayer/MusicPlayer/NetworkHandler.cs

@@ -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)