libmodbus icon indicating copy to clipboard operation
libmodbus copied to clipboard

Adding TCP server handling to libmodbus

Open kjeldflarup opened this issue 2 years ago • 1 comments

This is the same as for 3.1.4 https://github.com/stephane/libmodbus/pull/341

When creating a modbus server you must create your own TCP / socket server for libmodbus. This commit aims to integrate this handling into libmodbus.

Features:

  • Function to create a TCP server context where you specify port, ip and max_connection.
  • Handle function which must be called from a task or loop.
  • Destroy function with cleans up and correctly closes all current connections.
  • Function to change select timeout

Uses the modbus specifications method of 'disconnecting the last used connection if max_connection is reached' when accepting new incoming connections.

kjeldflarup avatar Dec 15 '21 14:12 kjeldflarup

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Johnny Rasmussen. This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email [email protected]
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

cla-bot[bot] avatar Dec 15 '21 14:12 cla-bot[bot]