| 1 |
# ping-pong |
| 2 |
|
| 3 |
ping-pong is a sctp example that shows how you can send/recv messages. |
| 4 |
In this example, there are 2 types of peers: **ping** and **pong**. |
| 5 |
|
| 6 |
**Ping** will always send `ping <seq_number>` messages to **pong** and receive `pong <seq_number>` messages from **pong**. |
| 7 |
|
| 8 |
**Pong** will always receive `ping <seq_number>` from **ping** and send `pong <seq_number>` messages to **ping**. |
| 9 |
|
| 10 |
## Instruction |
| 11 |
|
| 12 |
### Run ping and pong |
| 13 |
|
| 14 |
### Run pong |
| 15 |
|
| 16 |
```sh |
| 17 |
go run github.com/pion/sctp/examples/ping-pong/pong@latest |
| 18 |
``` |
| 19 |
|
| 20 |
|
| 21 |
### Run ping |
| 22 |
|
| 23 |
```sh |
| 24 |
go run github.com/pion/sctp/examples/ping-pong/ping@latest |
| 25 |
``` |