Ejemplo n.º 1
0
 public bool SendUnreliably(T item)
 {
     if (sock == null)
     {
         return(false);
     }
     //send the shit over udp
     byte[] binary = serializer.Serialize(item);
     if (binary.Length > 60000)
     {
         Console.WriteLine("The message attempted to be sent is too large. It is : " + binary.Length + " bytes.");
         return(false);
     }
     if (multiplexMode)
     {
         this.sock.SendTo(binary, new IPEndPoint(MultiplexerUtil.MULTIPLEXER_WIRELESS_IP, this.port));
         //Console.WriteLine("using mux");
     }
     else
     {
         this.sock.SendTo(binary, new IPEndPoint(this.ip, this.port));
         //Console.WriteLine("not mux");
     }
     totalPackets++;
     return(true);
 }
Ejemplo n.º 2
0
 public bool SendUnreliably(T item)
 {
     if (sock == null)
     {
         return(false);
     }
     //send the shit over udp
     byte[] binary = serializer.Serialize(item);
     if (binary.Length > 60000)
     {
         Console.WriteLine("The message attempted to be sent is too large. It is : " + binary.Length + " bytes.");
         return(false);
     }
     else
     {
         this.sock.SendTo(binary, new IPEndPoint(this.remoteIP, this.port));
     }
     totalPackets++;
     return(true);
 }