M
monarailguy42
Hello I am trying to write a simple ruby socket program. I am trying
to communicate to a device that once I establish a TCPSocket
connection I can pass it sql commands and it will return me data.
Here is what I have been trying.
require 'socket'
begin
t = TCPSocket.new('192.168.0.71', 8080)
rescue
puts "error: #{$!}"
else
# ... do something with the socket
t.write("select read_count from tag_id")
answer = t.gets
puts answer
# and terminate the connection when we're done
t.close
end
My answer contains nothing, so I know I must be doing something
wrong. The device I am communication to is a ThingMagic RFID M4 and
the manufacturer assures me that once a TCP Socket connection is
established that passing queries as above will give back data. I know
that the device is working from other tests. Any help would be
appreciated.
Thanks
Larry
to communicate to a device that once I establish a TCPSocket
connection I can pass it sql commands and it will return me data.
Here is what I have been trying.
require 'socket'
begin
t = TCPSocket.new('192.168.0.71', 8080)
rescue
puts "error: #{$!}"
else
# ... do something with the socket
t.write("select read_count from tag_id")
answer = t.gets
puts answer
# and terminate the connection when we're done
t.close
end
My answer contains nothing, so I know I must be doing something
wrong. The device I am communication to is a ThingMagic RFID M4 and
the manufacturer assures me that once a TCP Socket connection is
established that passing queries as above will give back data. I know
that the device is working from other tests. Any help would be
appreciated.
Thanks
Larry