2007-05-09 [長年日記]

_[netbsd][unix]connect - connect a socketはバックグラウンド動作する

んですね。 全く知りませんでしたよ。。。

If connect() is interrupted by a signal that is caught while blocked 
waiting to establish a connection, connect() shall fail and set
errno to [EINTR], but the connection request shall not be aborted,
and the connection shall be established asynchronously.
 
If the connection cannot be established immediately and O_NONBLOCK 
is set for the file descriptor for the socket, connect() shall fail 
and set errno to [EINPROGRESS], but the connection request shall not 
be aborted, and the connection shall be established asynchronously.

本日のツッコミ(全2件) [ツッコミを入れる]
_ nobby (2007-05-09 21:27)

socket先がどんなデバイスか分からないんだから、非同期なのはある意味当然では?
pollingするのバカバカしいし。

_ masterq (2007-05-09 23:46)

でもさー、シグナル中断とかしたら接続行為自体がキャンセルされちゃうよーな気しないっすか?
しないっすか。。。

[]
本日のリンク元