public void Send(byte[] buffer) { if (!IsWork) { return; } try { lock (socket) { buffer = EncDec.Encode(buffer); socket.Send(buffer); ConnectionStatus.SendedBytes += buffer.Length; } } catch { Close(); } }