Exemplo n.º 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);
        }
Exemplo n.º 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)
     {
     }
 }
Exemplo n.º 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)
     {
     }
 }
Exemplo n.º 4
0
 public void SendSync(IPEndPoint sendTo, XyzMessage message, int type = 0)
 {
     byte[] payload = new XyzMessageBuilder().Add(message).ToArray();
     this.SendSync(sendTo, payload, type);
 }
Exemplo n.º 5
0
 public void Send(XyzMessage message, int type = 0)
 {
     byte[] payload = new XyzMessageBuilder().Add(message).ToArray();
     this.Send(payload, type);
 }