/// <summary> /// Fires each time a packet is sent, the args contain the exchange state and the echo flag. /// </summary> private void OnPacketSent(object owner, DtmPacketArgs args) { if (!((DtmKex)owner).IsEstablished) { Console.WriteLine(CON_TITLE + String.Format("Server sent a packet; {0}", (DtmExchangeFlags)args.Message)); } }
/// <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, DtmPacketArgs args) { if (!((DtmKex)owner).IsEstablished) { Console.WriteLine(CON_TITLE + String.Format("Client received a packet; {0}", (DtmExchangeFlags)args.Message)); } if (args.Message == (short)DtmExchangeFlags.Established) { _initDone.Set(); } }
private void OnFileReceived(object owner, DtmPacketArgs args) { // file transfer is complete Console.WriteLine(CON_TITLE + "The file transfer has completed!"); Console.WriteLine(CON_TITLE); }