Socket States Flashcards
List the 6 events associated with WSAAsyncSelect( ).
FD_ACCEPT : (Socket State) connection pending: connection request received (stream sockets only)
FD_CLOSE : close pending: connection close received (graceful close or abort) (stream sockets only)
FD_CONNECT : connected : connection now established
FD_OOB : “Out of band” data readability (stream sockets only)
FD_READ : readable : data received by network system is ready for application to read
FD_WRITE : writable : send is possible (network system buffers available for outgoing data)
Why do events have re-enabling functions?
So that WinSock DLL can avoid flooding an application with notification messages.
What function detects readable socket state?
ioctlsocket() FIONREAD
What does the FD_ACCEPT event notify an application of?
the connection pending state (arrival of an incoming connection request)…indicates that a call to accept() should succeed immediately
A accept() call on a server signals a ______ on a client.
FD_CONNECT
A connect() call on a client signals a ______ on a server.
FD_ACCEPT
A send() call reenables a ________.
FD_WRITE
A recv() call reenables a __________.
FD_READ
closesocket() call signals a __________.
FD_CLOSE
Which of the following is/are part of the three basic methods of socket state detection?
a. asynchronous notification
b. function call for success or failure
c. synchronous detection
d. all answers are correct
d. all answers are correct
After the closesocket( ) function returns, any function call that references that socket descriptor will fail with a _____________________________ error.
a. None of these
b. WSAELASTERROR 10048
c. WSAENOTSOCK 10038
d. WSAERRLAST 10064
c. WSAENOTSOCK 10038
What function is the synchronous counterpart of WSAAsyncSelect( )?
select()
What is the name the parameter of the asynchronous notification message, which contains the socket handle.
wParam
___________detection means the WinSock DLL detects a socket state at any time after an application calls the asynchronous socket state detection function.
Asynchronous
A datagram socket is writable as soon as it is opened, and it is readable as soon as it is _________.
named