まず、受け側は ipfw のポートを開けます。 $ sudo ipfw add 10060 pass tcp from any to xxx.xxx.xxx.xxx 8080 setup keep-state で、 nc で LISTEN しますが、引数がポイント。 $ nc -l -N -d 8080 送る側からも nc で送ります。 $ echo "ABC" | nc xxx.xxx.xxx.xxx 8080 ポイントになるのは受け側の nc の引数で、 受けるのみなら -d で stdin を捨てて、 -N で終了後にソケットを shutdown をします。 これがないと、データを送り終…