Files
spring-integration-samples/basic/tcp-broadcast
2020-04-17 15:25:51 -04:00
..
2019-03-22 14:52:00 -04:00
2020-04-17 15:25:51 -04:00
2018-11-19 18:42:41 -05:00

== TCP Broadcast Sample

This sample demonstrates broadcasting a message received by a web controller to all connected TCP clients.

`curl -X POST http://localhost:8080/broadcast/foo` will send 'foo' to 5 connected clients.

The TCP server listens on port 1234.


`2018-11-19 12:01:48.546  INFO 98411 --- [           main] com.example.TcpBroadcastApplication      : Started TcpBroadcastApplication in 1.904 seconds (JVM running for 2.345)`
`connected! from client# 5`
`connected! from client# 4`
`connected! from client# 3`
`connected! from client# 2`
`connected! from client# 1`

`curl -X POST http://localhost:8080/broadcast/foo`

`foo from client# 4`
`foo from client# 5`
`foo from client# 2`
`foo from client# 1`
`foo from client# 3`

To shut down the application:

`curl http://localhost:8080/shutdown`