Commit 30f4fa70 authored by Pavel Vainerman's avatar Pavel Vainerman

(ModbusTCPCore): немного оптимизировал чтение (чтобы каждый раз

читалось не меньше 255 байт).
parent 59b109f4
......@@ -14,7 +14,7 @@
Name: libuniset2
Version: 2.4
Release: alt7
Release: alt8
Summary: UniSet - library for building distributed industrial control systems
License: LGPL
......@@ -484,6 +484,9 @@ mv -f %buildroot%python_sitelibdir_noarch/* %buildroot%python_sitelibdir/%oname
# ..
%changelog
* Fri Aug 19 2016 Pavel Vainerman <pv@altlinux.ru> 2.4-alt8
- ModbusTCPCore: minor optimization
* Fri Aug 19 2016 Pavel Vainerman <pv@altlinux.ru> 2.4-alt7
- minor fixes
......
......@@ -20,6 +20,7 @@ using namespace std;
using namespace ModbusRTU;
// -------------------------------------------------------------------------
#define USE_BUFFER_FOR_READ 1
#define DEFAULT_BUFFER_SIZE_FOR_READ 255
// -------------------------------------------------------------------------
size_t ModbusTCPCore::readNextData(UTCPStream* tcp,
std::queue<unsigned char>& qrecv, size_t max, timeout_t t )
......@@ -31,6 +32,8 @@ size_t ModbusTCPCore::readNextData(UTCPStream* tcp,
#ifdef USE_BUFFER_FOR_READ
max = std::max(max,(size_t)DEFAULT_BUFFER_SIZE_FOR_READ);
char* buf = new char[max];
if( buf == 0 )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment