static void Main(string[] args) { while (true) { TCPServer.Connect(); } }
static void Main(string[] args) //Method that starts the reading/listening { server.Start(); server.acceptConnectionRequests(); Console.WriteLine("Press <enter> to connect to this IP"); var pressed = Console.ReadKey(); if (pressed.Key == ConsoleKey.Enter) { if (server.FuseeIp != null) { server.Connect(server.FuseeIp); } else { Console.WriteLine("No IP to connect to"); } } Console.WriteLine("Press <enter> to send data"); pressed = Console.ReadKey(); if (pressed.Key == ConsoleKey.Enter) { try { byte[] binaryfile = server.ReadBinaryFile(binarydatapath); server.SendData(binaryfile); } catch (Exception exception) { Console.WriteLine("Error: " + exception); } } Console.Read(); //Console.WriteLine("Press <enter> to send data"); //Console.WriteLine("Press <space> to abort sending"); //pressed = Console.ReadKey(); //if (pressed.Key == ConsoleKey.Enter) //{ // try // { // packages = server.SplitandSendPackages(path); //split and send packages, store them // } // catch (Exception exception) // { // Console.WriteLine("Error: " + exception); // } //} }