From 84d59b0b599a336a2c3b382bd2fa3de3856ba861 Mon Sep 17 00:00:00 2001 From: syneffort Date: Tue, 15 Nov 2022 18:24:33 +0900 Subject: [PATCH] gzip disable option --- SocketStudy/PComm/PClient.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/SocketStudy/PComm/PClient.cs b/SocketStudy/PComm/PClient.cs index 95f7e87..bdb9f1d 100644 --- a/SocketStudy/PComm/PClient.cs +++ b/SocketStudy/PComm/PClient.cs @@ -28,6 +28,8 @@ namespace PComm public bool Connected { get { return socket.Connected; } } + public bool DataCompression { get; set; } = false; + private Socket socket; public PClient(string ip, int port, string id = null) @@ -73,7 +75,7 @@ namespace PComm byte[] toSendData; // 데이터 크기 100B 이하 또는 50MB 이상 압축하지 않음 (CPU 부하시간 더 큼) // 압축한 경우 1 전송, 아닌경우 0 전송 - if (data.Length <= 100 || data.Length >= 50000000) + if (DataCompression == false || data.Length <= 100 || data.Length >= 50000000) { byte[] isCompressed = BitConverter.GetBytes(false); socket.Send(isCompressed, SocketFlags.None);