Skip to content

Commit 58d6236

Browse files
Bugfix Excessive CPU Load - Server Application
1 parent 2d6368f commit 58d6236

File tree

5 files changed

+6
-7
lines changed

5 files changed

+6
-7
lines changed

EasyModbus/ModbusClient.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public enum RegisterOrder { LowHigh = 0, HighLow = 1 };
5656
public string MqttPassword { get; set; }
5757
public bool MqttPushOnChange { get; set; } = true;
5858

59-
public int MqttBrokerPort = 1883;
59+
public int MqttBrokerPort { get; set; } = 1883;
6060

6161
public delegate void ReceiveDataChanged(object sender);
6262
public event ReceiveDataChanged receiveDataChanged;
@@ -797,8 +797,7 @@ private void DataReceivedHandler(object sender,
797797

798798
byte[] rxbytearray = new byte[numbytes];
799799
sp.Read(rxbytearray, 0, numbytes);
800-
if (debug) StoreLogData.Instance.Store("Received Serial-Data: " + BitConverter.ToString(rxbytearray), System.DateTime.Now);
801-
Array.Copy(rxbytearray,0, readBuffer,actualPositionToRead, (actualPositionToRead + rxbytearray.Length) <= bytesToRead ? rxbytearray.Length : bytesToRead - actualPositionToRead);
800+
Array.Copy(rxbytearray,0, readBuffer,actualPositionToRead, (actualPositionToRead + rxbytearray.Length) <= bytesToRead ? rxbytearray.Length : bytesToRead - actualPositionToRead);
802801

803802
actualPositionToRead = actualPositionToRead + rxbytearray.Length;
804803

EasyModbus/ModbusServer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ private void ListenerThread()
371371
tcpHandler.dataChanged += new TCPHandler.DataChanged(ProcessReceivedData);
372372
tcpHandler.numberOfClientsChanged += new TCPHandler.NumberOfClientsChanged(numberOfClientsChanged);
373373
}
374-
if (serialFlag)
374+
else if (serialFlag)
375375
{
376376
if (serialport == null)
377377
{

EasyModbus/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@
2828
//
2929
// You can specify all the values or you can use the default the Revision and
3030
// Build Numbers by using the '*' as shown below:
31-
[assembly: AssemblyVersion("4.4")]
31+
[assembly: AssemblyVersion("4.4.1")]

EasyModbusClientExample/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@
2828
//
2929
// You can specify all the values or you can use the default the Revision and
3030
// Build Numbers by using the '*' as shown below:
31-
[assembly: AssemblyVersion("4.4")]
31+
[assembly: AssemblyVersion("4.4.1")]

EasyModbusServerSimulator/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@
2424
//
2525
// You can specify all the values or you can use the default the Revision and
2626
// Build Numbers by using the '*' as shown below:
27-
[assembly: AssemblyVersion ("4.4")]
27+
[assembly: AssemblyVersion ("4.4.1")]

0 commit comments

Comments
 (0)