Пример #1
0
 public void Send(IPBEPacket packet)
 {
     byte[] data = packet.Data.ToArray();
     if (_encryption is not null)
     {
         data = _encryption.Encrypt(data);
     }
     PBENetworkUtils.Send(data, Socket);
 }
Пример #2
0
 public void Send(IPBEPacket packet)
 {
     if (packet == null)
     {
         throw new ArgumentNullException(nameof(packet));
     }
     byte[] data = packet.Data.ToArray();
     if (_encryption != null)
     {
         data = _encryption.Encrypt(data);
     }
     PBENetworkUtils.Send(data, Socket);
 }
Пример #3
0
 public void Send(IPBEPacket packet)
 {
     if (!IsConnected)
     {
         throw new InvalidOperationException("Socket not connected.");
     }
     byte[] data = packet.Data.ToArray();
     if (_encryption is not null)
     {
         data = _encryption.Encrypt(data);
     }
     PBENetworkUtils.Send(data, _socket);
 }