0 Replies Latest reply on Jan 24, 2013 3:02 PM by Joop Koop

    Send Data to TCP Port (not websocket)

      Hi,

       

      I am trying to send data to a TCP port (999) of a Home Automation Control Station (server)

      Its a 'dumb"  TCP port, so websocket won't work.

       

      Added to following code to application.rb right after def initialize  (just for easy testing

       

          require 'socket'

          $_s = TCPSocket.open('192.168.1.101', 999)

          $_s.write("some_ascii_command_data")

       

      based on this example code:

      https://github.com/rhomobile/rhodes/blob/master/lib/extensions/debugger/debugger.rb

       

      And also added the net-http extension to build.yml following the information in this thread:

      https://groups.google.com/forum/#!msg/rhomobile/vk-NTUw4u-M/gGTusNE_Dr8J

       

      But after adding the code, the app won't even run in the android rhomobile emulator or android sdk emulator...

       

      Anyone here know to make this work?

       

      Thnx!

      JP