diff --git a/examples/server_async.py b/examples/server_async.py index c5fec0853..291aa6eb0 100755 --- a/examples/server_async.py +++ b/examples/server_async.py @@ -160,7 +160,6 @@ async def run_async_server(args): # broadcast_enable=False, # treat slave_id 0 as broadcast address, # timeout=1, # waiting time for request to complete # TBD strict=True, # use strict timing, t1.5 for Modbus RTU - # defer_start=False, # Only define server do not activate ) elif args.comm == "udp": address = ("127.0.0.1", args.port) if args.port else None @@ -175,7 +174,6 @@ async def run_async_server(args): # broadcast_enable=False, # treat slave_id 0 as broadcast address, # timeout=1, # waiting time for request to complete # TBD strict=True, # use strict timing, t1.5 for Modbus RTU - # defer_start=False, # Only define server do not activate ) elif args.comm == "serial": # socat -d -d PTY,link=/tmp/ptyp0,raw,echo=0,ispeed=9600 @@ -196,7 +194,6 @@ async def run_async_server(args): # ignore_missing_slaves=True, # ignore request to a missing slave # broadcast_enable=False, # treat slave_id 0 as broadcast address, # strict=True, # use strict timing, t1.5 for Modbus RTU - # defer_start=False, # Only define server do not activate ) elif args.comm == "tls": address = ("", args.port) if args.port else None @@ -226,7 +223,6 @@ async def run_async_server(args): # broadcast_enable=False, # treat slave_id 0 as broadcast address, # timeout=1, # waiting time for request to complete # TBD strict=True, # use strict timing, t1.5 for Modbus RTU - defer_start=False, # Only define server do not activate ) return server diff --git a/examples/server_sync.py b/examples/server_sync.py index 7d70c6745..ac21f6490 100755 --- a/examples/server_sync.py +++ b/examples/server_sync.py @@ -71,7 +71,6 @@ def run_sync_server(args): # broadcast_enable=False, # treat slave_id 0 as broadcast address, # timeout=1, # waiting time for request to complete # TBD strict=True, # use strict timing, t1.5 for Modbus RTU - # defer_start=False, # Only define server do not activate ) elif args.comm == "udp": address = ("", args.port) if args.port else None @@ -88,7 +87,6 @@ def run_sync_server(args): # broadcast_enable=False, # treat slave_id 0 as broadcast address, # timeout=1, # waiting time for request to complete # TBD strict=True, # use strict timing, t1.5 for Modbus RTU - # defer_start=False, # Only define server do not activate ) elif args.comm == "serial": # socat -d -d PTY,link=/tmp/ptyp0,raw,echo=0,ispeed=9600 @@ -109,7 +107,6 @@ def run_sync_server(args): # ignore_missing_slaves=True, # ignore request to a missing slave # broadcast_enable=False, # treat slave_id 0 as broadcast address, # strict=True, # use strict timing, t1.5 for Modbus RTU - # defer_start=False, # Only define server do not activate ) elif args.comm == "tls": address = ("", args.port) if args.port else None @@ -139,7 +136,6 @@ def run_sync_server(args): # broadcast_enable=False, # treat slave_id 0 as broadcast address, # timeout=1, # waiting time for request to complete # TBD strict=True, # use strict timing, t1.5 for Modbus RTU - # defer_start=False, # Only define server do not activate ) return server diff --git a/pymodbus/server/async_io.py b/pymodbus/server/async_io.py index 68f76e971..babf3f417 100644 --- a/pymodbus/server/async_io.py +++ b/pymodbus/server/async_io.py @@ -593,7 +593,6 @@ def __init__( address=None, handler=None, allow_reuse_address=False, - defer_start=False, backlog=20, **kwargs, ): @@ -648,7 +647,7 @@ def __init__( self.factory_parms = { "reuse_address": allow_reuse_address, "backlog": backlog, - "start_serving": not defer_start, + "start_serving": True, } async def serve_forever(self): @@ -714,7 +713,6 @@ def __init__( # pylint: disable=too-many-arguments reqclicert=False, handler=None, allow_reuse_address=False, - defer_start=False, backlog=20, **kwargs, ): @@ -755,7 +753,6 @@ def __init__( # pylint: disable=too-many-arguments address=address, handler=handler, allow_reuse_address=allow_reuse_address, - defer_start=defer_start, backlog=backlog, **kwargs, ) @@ -778,7 +775,6 @@ def __init__( identity=None, address=None, handler=None, - defer_start=False, backlog=20, **kwargs, ): @@ -801,7 +797,6 @@ def __init__( manipulating the response """ # TO BE REMOVED: - self.defer_start = defer_start self.backlog = backlog # ---------------- self.loop = asyncio.get_running_loop() diff --git a/pymodbus/server/reactive/main.py b/pymodbus/server/reactive/main.py index 3f2b2261d..9c8b5942c 100644 --- a/pymodbus/server/reactive/main.py +++ b/pymodbus/server/reactive/main.py @@ -509,7 +509,6 @@ def factory( # pylint: disable=dangerous-default-value,too-many-arguments framer=framer, identity=identity, address=(host, modbus_port), - defer_start=False, **kwargs, ) return ReactiveServer(host, web_port, server) diff --git a/test/test_server_asyncio.py b/test/test_server_asyncio.py index 65ee4faef..2f2be1643 100755 --- a/test/test_server_asyncio.py +++ b/test/test_server_asyncio.py @@ -139,13 +139,12 @@ def handle_task(self, result): result = result.result() async def start_server( - self, do_forever=True, do_defer=True, do_tls=False, do_udp=False, do_ident=False + self, do_forever=True, do_tls=False, do_udp=False, do_ident=False ): """Handle setup and control of tcp server.""" args = { "context": self.context, "address": SERV_ADDR, - "defer_start": do_defer, } if do_ident: args["identity"] = self.identity