Example #1
0
 public void Write(byte[] data)
 {
     try
     {
         StreamUtil.Write(GetStream(), data);
     }
     catch (Exception e)
     {
         Close();
         onDisconnect?.Invoke(this, e.Message);
     }
 }
Example #2
0
 public void Send(NetworkStream stream)
 {
     StreamUtil.Write(stream, GetBytes());
 }