diff --git a/MusicPlayer/MusicPlayer/APIHandler.cs b/MusicPlayer/MusicPlayer/APIHandler.cs new file mode 100644 index 0000000..59e719c --- /dev/null +++ b/MusicPlayer/MusicPlayer/APIHandler.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WindowsFormsApplication2 +{ + class APIHandler + { + } +} diff --git a/MusicPlayer/MusicPlayer/NetworkHandler.cs b/MusicPlayer/MusicPlayer/NetworkHandler.cs new file mode 100644 index 0000000..c207af2 --- /dev/null +++ b/MusicPlayer/MusicPlayer/NetworkHandler.cs @@ -0,0 +1,33 @@ +using System.Text; +using System.Net.Sockets; + +namespace WindowsFormsApplication2 +{ + class NetworkHandler + { + private int port = 8585; + private Socket s; + + public NetworkHandler(string ip) + { + s = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); + s.Connect(ip, port); + } + + public void SendString(string m) + { + byte[] req_as_bytes = Encoding.UTF8.GetBytes(m); + s.Send(req_as_bytes); + } + + public void ReceiveData() + { + while (s.Connected) + { + byte[] data = new byte[1024 * 200]; + int t = s.Receive(data); + //Iets doen met api calls + } + } + } +}