Exemplo n.º 1
0
 private void OnIncomingConnection(object sender, IncomigConnectionEventArgs e)
 {
     e._connection._incomingMessage += OnIncomingMessage;
     // workaround for response that has not come yet
     System.Threading.Thread.Sleep(1000);
     e._connection.Receive();
 }
        private static void OnIncomingConnection(object sender, IncomigConnectionEventArgs e)
        {
            // generate both public and private keys
            _n = RSA.GetN(); _e = RSA.GetE(); _d = RSA.GetD(_e);

            // send public key
            IMessage message = new TextMessage(_n.ToString() + ' ' + _e.ToString());

            e._connection.Send(message);

            e._connection._incomingMessage += OnIncomingMessage;
            // workaround for response that has not come yet
            System.Threading.Thread.Sleep(1000);
            e._connection.Receive();
        }