Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/package_test_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def callback_data(self, data: bytes, addr: tuple | None = None) -> int:
return len(data)

def callback_connected(self) -> None:
"""Call when connection is succcesfull."""
"""Call when connection is successful."""

def callback_disconnected(self, exc: Exception | None) -> None:
"""Call when connection is lost."""
Expand Down
4 changes: 2 additions & 2 deletions pymodbus/server/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ async def serve_forever(self, *, background: bool = False):
Log.info("Server graceful shutdown.")

def callback_connected(self) -> None:
"""Call when connection is succcesfull."""
raise RuntimeError("callback_new_connection should never be called")
"""Call when connection is successful."""
raise RuntimeError("callback_connected should never be called")

def callback_disconnected(self, exc: Exception | None) -> None:
"""Call when connection is lost."""
Expand Down
6 changes: 1 addition & 5 deletions pymodbus/server/requesthandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from pymodbus.logging import Log
from pymodbus.pdu.pdu import ExceptionResponse
from pymodbus.transaction import TransactionManager
from pymodbus.transport import CommParams, ModbusProtocol
from pymodbus.transport import CommParams


class ServerRequestHandler(TransactionManager):
Expand Down Expand Up @@ -40,10 +40,6 @@ def __init__(self, owner, trace_packet, trace_pdu, trace_connect):
trace_connect,
)

def callback_new_connection(self) -> ModbusProtocol:
"""Call when listener receive new connection request."""
raise RuntimeError("callback_new_connection should never be called")

def callback_disconnected(self, call_exc: Exception | None) -> None:
"""Call when connection is lost."""
super().callback_disconnected(call_exc)
Expand Down
2 changes: 1 addition & 1 deletion pymodbus/transaction/transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def callback_new_connection(self):
"""Call when listener receive new connection request."""

def callback_connected(self) -> None:
"""Call when connection is succcesfull."""
"""Call when connection is successful."""
self.count_until_disconnect = self.max_until_disconnect
self.next_tid = 0
self.trace_connect(True)
Expand Down
2 changes: 1 addition & 1 deletion pymodbus/transport/transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ def callback_new_connection(self) -> ModbusProtocol:

@abstractmethod
def callback_connected(self) -> None:
"""Call when connection is succcesfull."""
"""Call when connection is successful."""

@abstractmethod
def callback_disconnected(self, exc: Exception | None) -> None:
Expand Down
2 changes: 1 addition & 1 deletion test/transport/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def callback_new_connection(self) -> ModbusProtocol:
return DummyProtocol(params=self.comm_params, is_server=False)

def callback_connected(self) -> None:
"""Call when connection is succcesfull."""
"""Call when connection is successful."""

def callback_disconnected(self, exc: Exception | None) -> None:
"""Call when connection is lost."""
Expand Down