Skip to content

Commit 1aa9364

Browse files
committed
update doc.
1 parent 044a82f commit 1aa9364

File tree

5 files changed

+16
-2
lines changed

5 files changed

+16
-2
lines changed

pymodbus/client/serial.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,9 @@ def run():
197197
client.connect()
198198
...
199199
client.close()
200+
201+
202+
Remark: There are no automatic reconnect as with AsyncModbusSerialClient
200203
"""
201204

202205
state = ModbusTransactionState.IDLE

pymodbus/client/tcp.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,8 @@ async def run():
193193
client.connect()
194194
...
195195
client.close()
196+
197+
Remark: There are no automatic reconnect as with AsyncModbusTcpClient
196198
"""
197199

198200
def __init__(
@@ -354,7 +356,7 @@ def _handle_abrupt_socket_close(
354356
)
355357
if data:
356358
result = b"".join(data)
357-
Log.warning(" after returning {} bytes", len(result))
359+
Log.warning(" after returning {} bytes: {} ", len(result), result)
358360
return result
359361
msg += " without response from unit before it closed connection"
360362
raise ConnectionException(msg)

pymodbus/client/tls.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@ async def run():
131131
client.connect()
132132
...
133133
client.close()
134+
135+
136+
Remark: There are no automatic reconnect as with AsyncModbusTlsClient
134137
"""
135138

136139
def __init__(

pymodbus/client/udp.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,8 @@ async def run():
194194
client.connect()
195195
...
196196
client.close()
197+
198+
Remark: There are no automatic reconnect as with AsyncModbusUdpClient
197199
"""
198200

199201
def __init__(

test/test_server_task.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,7 @@ def test_sync_task_server_stop(comm):
271271
"""Test normal client/server handling."""
272272
run_server, server_args, run_client, client_args = helper_config(comm, "sync")
273273
if comm in {"tls", "udp", "serial", "tcp"}:
274+
# CURRENTLY NOT SUPPORTED.
274275
return
275276

276277
thread = Thread(target=run_server, kwargs=server_args)
@@ -285,6 +286,8 @@ def test_sync_task_server_stop(comm):
285286

286287
# Server breakdown
287288
server.ServerStop()
289+
thread.join()
290+
sleep(0.1)
288291

289292
with pytest.raises((ConnectionException, asyncio.exceptions.TimeoutError)):
290293
rr = client.read_coils(1, 1, slave=0x01)
@@ -294,9 +297,10 @@ def test_sync_task_server_stop(comm):
294297
thread = Thread(target=run_server, kwargs=server_args)
295298
thread.daemon = True
296299
thread.start()
300+
sleep(0.1)
297301

298302
timer_allowed = 100
299-
while not client.protocol:
303+
while not client.socket:
300304
sleep(0.1)
301305
timer_allowed -= 1
302306
if not timer_allowed:

0 commit comments

Comments
 (0)