Basically, we have a large (100+) number of remote embedded devices that we need for streaming data.
I can connect to any single remote host with the following code:
require 'socket' socket = TCPSocket.new '192.168.1.115', 8016 loop do socket.write("GET_DATA") data = socket.read(32) end s.close
But I want to contact many of them at once. Is there a recommended way to do this?
source share