荻野です。

On 2003.8.19, at 10:56 Asia/Tokyo, IWAOKA Masahiro wrote:

> 神戸さんのテストプログラムですが、相手によっては EALREADY の時間が
> 長いので、以下のように変更して実行しました。
(略)

> こちらも、EALREADY の処理を入れると同じようになりそうですね。

同じ、なんでしょうか? Invalid argument で終了するのは同じなんですが、
うちでは、そのときには getsockopt => 0 なんです。MacOS X も同様。

最後の Operation already in progress で、getsockopt => Connection refused
Invalid argument のときには、getsockopt => 0

になっています。(神戸さんと同じように見えます)

# わかっていないのでどうでもいいことに引っかかっているのかも知れませんが。

FreeBSD5.1R (p2相当)

$ ./a.out 192.168.0.103 1234
connect to family = 2, port = 1234, addr = 192.168.0.103
connect: Operation now in progress
getsockopt => 0
connect to family = 2, port = 1234, addr = 192.168.0.103
connect: Operation already in progress
getsockopt => 0
(Operation already in progress の繰り返し)
connect to family = 2, port = 1234, addr = 192.168.0.103
connect: Operation already in progress
getsockopt => Connection refused
connect to family = 2, port = 1234, addr = 192.168.0.103
connect: Invalid argument
getsockopt => 0


MacOS X 10.2.6 (Darwin 6.6):

$ ./a.out 192.168.0.1 12345
connect to family = 2, port = 12345, addr = 192.168.0.1
connect: Operation now in progress
getsockopt => 0
connect to family = 2, port = 12345, addr = 192.168.0.1
connect: Operation already in progress
getsockopt => 0
(Operation already in progress の繰り返し)
connect to family = 2, port = 12345, addr = 192.168.0.1
connect: Operation already in progress
getsockopt => 0
connect to family = 2, port = 12345, addr = 192.168.0.1
connect: Operation already in progress
getsockopt => Connection refused
connect to family = 2, port = 12345, addr = 192.168.0.1
connect: Invalid argument
getsockopt => 0



-- 
荻野 充 (おぎの みつる) ... 「萩(はぎ)」にあらず
Verama Systems

Key fingerprint = 7F26 5414 1805 F31B 1617  10B7 C117 07AE 1691 9BD1