Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Thread safety  #16

@atimin

Description

@atimin

I think that a serious project must be thread safe. I offer to add it to rmodbus-2 and this code will be working a perfect:

   sl1 = ModBus::TCPClient.new("192.168.1.1").with_slave(1)
   sl2 = ModBus::TCPClient.new("192.168.1.2").with_slave(2)

   Thread.new do
      loop { puts sl1.holding_registers[0..10] }
   end

   loop { puts sl2.holding_registers[0..10] }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions