public byte[] Read() { byte[] buffer; try { int count = StreamFrom.Read(bufferRead, 0, bufferRead.Length); if (count == 0) { return(null); } else { if (userFrom != null) { Conf.Users[userFrom].CheckSpeed(count); } } buffer = new byte[count]; Array.Copy(bufferRead, buffer, count); if (EncryptFrom) { buffer = Decrypt(buffer); } } catch (Exception ex) { Console.WriteLine(ex.Message); StreamFrom.Close(); clientFrom.Close(); return(null); } return(buffer); }
public byte[] Read() { byte[] buffer; try { int count = StreamFrom.Read(bufferRead, 0, bufferRead.Length); if (count == 0) { return(null); } buffer = new byte[count]; Array.Copy(bufferRead, buffer, count); if (EncryptFrom) { buffer = Decrypt(buffer); } } catch { StreamFrom.Close(); clientFrom.Close(); return(null); } return(buffer); }