Пример #1
0
 private void Client_SendCompleted(NetWorkArgs args)
 {
     try
     {
         if (args.State == NetworkState.Sended)
         {
             NetworkIOArgs arg = args as NetworkIOArgs;
             Type          t   = this.GetType();
             System.Reflection.MethodInfo callback = t.GetMethod(sendMethodName[(int)this.sendstate].Trim(), BindingFlags.NonPublic | BindingFlags.Instance);
             object[] param = new object[] { arg };
             callback.Invoke(this, param);
         }
     }
     catch
     {
     }
 }
Пример #2
0
 private void Client_RecvCompleted(NetWorkArgs args)
 {
     try
     {
         if (args.State == NetworkState.Recved)
         {
             NetworkIOArgs arg      = args as NetworkIOArgs;
             Type          t        = this.GetType();
             MethodInfo    callback = t.GetMethod(recvMethodName[(int)this.recvState].Trim(), BindingFlags.NonPublic | BindingFlags.Instance);
             object[]      param    = new object[] { arg };
             callback.Invoke(this, param);
         }
     }
     catch
     {
     }
 }