Exemplo n.º 1
0
 public void Send(MiMFa_SimplePacket packet)
 {
     try
     {
         LastSendPacket = packet;
         Sender.Start(LastSendPacket, INAddress);
         SendPacket(LastSendPacket, Sender.InterlocutorIPEndPoint);
     }
     catch (Exception ex)
     {
         SendError(RTB.Text, Sender.InterlocutorIPEndPoint, 0, ex);
         NotSendAlert(ex);
     }
 }
Exemplo n.º 2
0
 public virtual object mode0(params object[] po)
 {
     if (reciever == null)
     {
         reciever = new MiMFa_Receiver();
         sender   = new MiMFa_Sender();
         reciever.EndReceiveData += (o, ip, i) => content = echo(o).ToString();
         sender.EndSendData      += (o, ip, i) => content = echo(ip).ToString();
     }
     sender.BufferSize = reciever.BufferSize = buffer;
     sender.Port       = reciever.Port = port;
     reciever.Timeout  = receivetimeout;
     sender.Timeout    = sendtimeout;
     sender.Run        = reciever.Run = !_pause;
     if ((_send || s) && po.Length > 1)
     {
         for (int i = 1; i < po.Length; i++)
         {
             sender.Start(po[0], po[i].ToString());//
         }
         return(Null);
     }
     else if (_receive || r)
     {
         if (po != null && po.Length > 0)
         {
             for (int i = 0; i < po.Length; i++)
             {
                 reciever.Start(IPAddress.Parse(po[i].ToString()));
             }
         }
         else
         {
             reciever.Start(IPAddress.Any);
         }
     }
     return(Null);
 }