public MyServer(int port, string username, string password, MainWindow w)
        {
            try
            {
                exch = new ECDiffieHellmanCng(256);
                exch.KeyDerivationFunction = ECDiffieHellmanKeyDerivationFunction.Hash;
                exch.HashAlgorithm = CngAlgorithm.Sha256;
                publicKey = exch.PublicKey.ToByteArray();
                this.username = username;
                this.password = password;
                this.Window = w;
                input = new Input();
                mcb = new MyClipBoard();
                localpt = new IPEndPoint(IPAddress.Any, port);
                /* Initializes the Listener */
                myList = new TcpListener(localpt);
                uclient = new UdpClient();
                uclient.Client.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true);
                uclient.DontFragment = true;
                uclient.Client.Bind(localpt);
                /* Start Listening at the specified port */
                myList.Start();
                Console.WriteLine("The server is running at port 8001...");
                Console.WriteLine("The local End point is :" + myList.LocalEndpoint);
                Console.WriteLine("Waiting for a connection.....");

                Thread t3 = new Thread(InputProcessing);
                t3.Start();
                Thread t = new Thread(ClipBoardProcessing); //LOGIN AND CLIPBOARD PROCESSING
                t.SetApartmentState(ApartmentState.STA);
                t.Start();

            }
            catch (SocketException se)
            {
                if (se.ErrorCode == 10048)
                {
                    throw se;
                }
                Console.WriteLine(se.Message + " " + se.ErrorCode);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }
        public MyServer(int port, string username, string password, MainWindow w)
        {
            try
            {
                exch = new ECDiffieHellmanCng(256);
                exch.KeyDerivationFunction = ECDiffieHellmanKeyDerivationFunction.Hash;
                exch.HashAlgorithm         = CngAlgorithm.Sha256;
                publicKey     = exch.PublicKey.ToByteArray();
                this.username = username;
                this.password = password;
                this.Window   = w;
                input         = new Input();
                mcb           = new MyClipBoard();
                localpt       = new IPEndPoint(IPAddress.Any, port);
                /* Initializes the Listener */
                myList  = new TcpListener(localpt);
                uclient = new UdpClient();
                uclient.Client.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true);
                uclient.DontFragment = true;
                uclient.Client.Bind(localpt);
                /* Start Listening at the specified port */
                myList.Start();
                Console.WriteLine("The server is running at port 8001...");
                Console.WriteLine("The local End point is :" + myList.LocalEndpoint);
                Console.WriteLine("Waiting for a connection.....");

                Thread t3 = new Thread(InputProcessing);
                t3.Start();
                Thread t = new Thread(ClipBoardProcessing); //LOGIN AND CLIPBOARD PROCESSING
                t.SetApartmentState(ApartmentState.STA);
                t.Start();
            }
            catch (SocketException se)
            {
                if (se.ErrorCode == 10048)
                {
                    throw se;
                }
                Console.WriteLine(se.Message + " " + se.ErrorCode);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }