LoginSignup
3
5

More than 5 years have passed since last update.

linux > udpで "TEST2" を送信する > echo "TEST2" | nc -u 192.168.10.6 6000

Last updated at Posted at 2015-09-04
動作確認
1. MacOS X 10.8.5 > ターミナル
2. CentOS 6.5 (32bit)

UDPのポート6000でテキストを送信する場合、以下を実行する。

$ echo "TEST2" | nc -u 192.168.10.6 6000
TEST2

192.168.10.6ではUDP echo serverを立てているので、送信した文字がそのまま返ってきている。

-uをつけることでUDP通信にしている。-uがない時はTCP通信になるようだ。

3
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
5