Skip to content

Commit

Permalink
Remove references to "defer_start". (#1548)
Browse files Browse the repository at this point in the history
  • Loading branch information
janiversen authored May 24, 2023
1 parent 4334930 commit 8329392
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 17 deletions.
4 changes: 0 additions & 4 deletions examples/server_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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

Expand Down
4 changes: 0 additions & 4 deletions examples/server_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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

Expand Down
7 changes: 1 addition & 6 deletions pymodbus/server/async_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,6 @@ def __init__(
address=None,
handler=None,
allow_reuse_address=False,
defer_start=False,
backlog=20,
**kwargs,
):
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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,
):
Expand Down Expand Up @@ -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,
)
Expand All @@ -778,7 +775,6 @@ def __init__(
identity=None,
address=None,
handler=None,
defer_start=False,
backlog=20,
**kwargs,
):
Expand All @@ -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()
Expand Down
1 change: 0 additions & 1 deletion pymodbus/server/reactive/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions test/test_server_asyncio.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8329392

Please sign in to comment.