Exemple #1
0
 /// <summary>
 /// Fires when a file send operation completes
 /// </summary>
 private void OnFileSent(object owner, DtmPacketEventArgs args)
 {
     if (FileSent != null)
         FileSent(this, args);
 }
Exemple #2
0
        /// <summary>
        /// Fires when a file received operation has completed
        /// </summary>
        private void OnFileReceived(object owner, DtmPacketEventArgs args)
        {
            if (FileReceived != null)
                FileReceived(this, args);

            lock (_fileLock)
            {
                // ackowledge file received and cleanup
                Transmit(DtmPacketTypes.Transfer, (short)DtmTransferFlags.Received, args.OptionFlag);
                Wait(10);
                // close processor
                CloseTransfer(args.OptionFlag);
            }
        }
Exemple #3
0
 /// <summary>
 /// Fires each time a packet is sent, the args contain the exchange state and the echo flag.
 /// </summary>
 private void OnPacketSent(object owner, DtmPacketEventArgs args)
 {
     if (!((DtmKex)owner).IsEstablished)
         Console.WriteLine(CON_TITLE + String.Format("Server sent a packet; {0}", (DtmExchangeFlags)args.Message));
 }
Exemple #4
0
 private void OnFileReceived(object owner, DtmPacketEventArgs args)
 {
     // file transfer is complete
     Console.WriteLine(CON_TITLE + "The file transfer has completed!");
     Console.WriteLine(CON_TITLE);
 }
Exemple #5
0
        /// <summary>
        /// Fires each time a packet is received, the args contain the exchange state. 
        /// The size of the payload and a Cancel token, when set to true, will terminate the session
        /// </summary>
        private void OnPacketReceived(object owner, DtmPacketEventArgs args)
        {
            if (!((DtmKex)owner).IsEstablished)
                Console.WriteLine(CON_TITLE + String.Format("Server received a packet; {0}", (DtmExchangeFlags)args.Message));

            // exchange completed
            if (args.Message == (short)DtmExchangeFlags.Established)
                _initDone.Set();
        }