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: |
|
| Constraints: |
|
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:
|
|
| Description | connection description |
Example Scenario Using TCP
Given
- Thing has remote method "echo"
- Thing wants to be able to handle this method
Workflow
- Thing creates a socket server
- GadgetKeeper opens a TCP connection to Thing socket server
-
GadgetKeeper writes a JSON command to the TCP connection:
-
Thing reads the JSON command and writes a response back to the TCP connection:
-
GadgetKeeper receives the response and closes the TCP connection
