public void Process() { while (true) { Console.WriteLine("Insert first number"); float firstNum = Convert.ToSingle(Console.ReadLine()); Console.WriteLine("Insert second number"); float secondNum = Convert.ToSingle(Console.ReadLine()); Console.WriteLine("Select operator (0 = +, 1 = -, 2 = *, 3 = /"); byte command = Convert.ToByte(Console.ReadLine()); Packet packet = new Packet(command, firstNum, secondNum); byte[] data = packet.GetData(); socket.SendTo(data, serverEndPoint); byte[] response = new byte[data.Length]; int rlen = socket.Receive(response); Console.WriteLine(BitConverter.ToSingle(response, 1)); } }