| [ CnUnix ] in KIDS 글 쓴 이(By): swhan (Nameless 1) 날 짜 (Date): 2003년 2월 19일 수요일 오전 11시 52분 24초 제 목(Title): Re: [Q] socket에서 connect() 실패할지를 미리 알 방법은 없다고 알고 있습니다만... 혹시 원하시는게 한 3초만 기둘러서 접속이 이루어지지 않으면 다른 시도를 하겠다...하시는거면, (위에 두 분이 그쪽으로 답을 주셨는데) EINPROGRESS The socket is non-blocking and the connection can� not be completed immediately. It is possible to select(2) or poll(2) for completion by selecting the socket for writing. After select indicates writability, use getsockopt(2) to read the SO_ERROR option at level SOL_SOCKET to determine whether connect completed successfully (SO_ERROR is zero) or unsuccessfully (SO_ERROR is one of the usual error codes listed here, explaining the reason for the failure). EALREADY The socket is non-blocking and a previous connec� tion attempt has not yet been completed. @ async I/O는 모든 OS가 제공하진 않지만, non-block I/O라면 대부분 제공할겁니다. |