Skip to content

Commit

Permalink
tcp over command line
Browse files Browse the repository at this point in the history
  • Loading branch information
mihaidma committed May 12, 2016
1 parent 7da4a55 commit f6acc88
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,21 @@ seneca()
You can cheat by running the HTTP examples with the additional command
line option: <code>--seneca.options.transport.type=tcp</code>.
To communicate with a Seneca instance over TCP you can send from command line a message that Seneca understands:
```sh
# call the color:red action pattern
echo '{"id":"w91/enj","kind":"act","origin":"h5x/146/..77/-","act":{"color":"red"},"sync":true}' | nc 127.0.0.1 10201
```
Seneca answers with a message like:
```sh
{"id":"w91/enj","kind":"res","origin":"h5x/146/..77/-","accept":"bj../14../..47/-","time":{"client_sent":..,"listen_recv":..,"listen_sent":..},"sync":true,"res":{"hex":"#FF0000"}}
# the produced result is in the "res" field
```
HTTP and TCP are not the only transport mechanisms available. Of
course, in true Seneca-style, the other mechanisms are available as
plugins. Here's the list.
Expand Down

0 comments on commit f6acc88

Please sign in to comment.