Beispiel #1
0
        public void Send(IPEndPoint sendTo, XyzMessage[] messages, int type = 0)
        {
            XyzMessageBuilder builder = new XyzMessageBuilder();

            foreach (XyzMessage message in messages)
            {
                builder.Add(message);
            }
            this.Send(sendTo, builder.ToArray(), type);
        }
Beispiel #2
0
 public void Send(IPEndPoint sendTo, byte[] data, int type = 0)
 {
     try
     {
         byte[] payload = new XyzMessageBuilder().Add(XyzUtils.Deflate(data), type).ToArray();
         this.client.BeginSend(payload, payload.Length, sendTo, null, this.client);
     }
     catch (Exception)
     {
     }
 }
Beispiel #3
0
 public async void Send(byte[] data, int type = 0)
 {
     try
     {
         byte[] payload = new XyzMessageBuilder().Add(XyzUtils.Deflate(data), type).ToArray();
         await this.stream.WriteAsync(payload, 0, payload.Length);
     }
     catch (Exception)
     {
     }
 }
Beispiel #4
0
 public void SendSync(IPEndPoint sendTo, XyzMessage message, int type = 0)
 {
     byte[] payload = new XyzMessageBuilder().Add(message).ToArray();
     this.SendSync(sendTo, payload, type);
 }
Beispiel #5
0
 public void Send(XyzMessage message, int type = 0)
 {
     byte[] payload = new XyzMessageBuilder().Add(message).ToArray();
     this.Send(payload, type);
 }