Skip to end of metadata
Go to start of metadata

Thing creates a TCP socket server, GadgetKeeper connects to it to exchange messages.

Communication Protocols: TCP
RPC Protocol: JSON-RPC 2.0
How it works:
  1. Thing creates a socket server
  2. GadgetKeeper opens a TCP connection to Thing socket server
  3. GadgetKeeper writes a command to the TCP connection
  4. Thing reads the command from the TCP connection
  5. Thing writes a response to the TCP connection
  6. GadgetKeeper reads the response
  7. GadgetKeeper closes the connection
Constraints:
  1. Thing must be reachable from GadgetKeeper

 

Connection Settings


Field Required Description Dialog
Name x connection name
Protocol x select "json-rpc over tcp"
Host x Thing host
Port x Thing socket server port
Secure   use SSL
Connection, ms x

number of milliseconds GadgetKeeper can spent on connection to Thing

Response, ms x

number of milliseconds GadgetKeeper will wait for Thing

to receive message and send response

Date format x

date format representation:

  • iso-8601 - date is represented as string (example: "2013-05-27UTC06:07:16Z")
  • unix-timestamp - not supported, date is represented as number (example: 1369634836)
Description   connection description

 

Example Scenario Using TCP


Given

  1. Thing has remote method "echo" 
  2. Thing wants to be able to handle this method


Workflow

  1. Thing creates a socket server
  2. GadgetKeeper opens a TCP connection to Thing socket server
  3. GadgetKeeper writes a JSON command to the TCP connection:

  4. Thing reads the JSON command and writes a response back to the TCP connection:

  5. GadgetKeeper receives the response and closes the TCP connection

 



 

  • No labels