오후 10:23 2002-08-07
조경민 bro@shinbiro.com
블러킹소켓에서 closesocket시 보낼데이타 모두 보내게 기달리기
========================================================================
블러킹 소켓에서 SO_LINGER가 0이 아닌 타임아웃 값으로 설정되어 있다면,
closesocket은 남은 데이타가 타임아웃시간동안 다 보내질때까지 기다리게
된다. 이를 칭하여 '우아한 끊기-_-'라고 한다. 만일 타임아웃값이 다 되기
전에 모든 데이타가 가지 못한다면, 윈속 내부 구현은 closesocket이 리턴
되기도 전에 연결을 종료 시킨다.
If SO_LINGER is set with a nonzero time-out interval on a blocking socket,
the closesocket call blocks on a blocking socket until the remaining data
has been sent or until the time-out expires. This is called a graceful
disconnect. If the time-out expires before all data has been sent, the
Windows Sockets implementation terminates the connection before
closesocket returns.

만일 SO_LINGER가 0이 아닌 타임아웃값으로 설정되어 있다면
블러킹 소켓에서는, 정해진 시간내에서 다 보낼때까지 기다린다.
넌블러킹 소켓에서는, 바로 지정된 실패값이 리턴된다.
If SO_LINGER is enabled with a nonzero time-out:
? with a blocking socket, it blocks until all data sent or time-out expires.
- with a nonblocking socket, it returns immediately indicating failure

+ Recent posts