Socket States Flashcards Preview

Multi-User Game Programming > Socket States > Flashcards

Flashcards in Socket States Deck (17)
Loading flashcards...
1

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)

2

Why do events have re-enabling functions?

So that WinSock DLL can avoid flooding an application with notification messages.

3

What function detects readable socket state?

ioctlsocket() FIONREAD

4

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

5

A accept() call on a server signals a ______ on a client.

FD_CONNECT

6

A connect() call on a client signals a ______ on a server.

FD_ACCEPT

7

A send() call reenables a ________.

FD_WRITE

8

A recv() call reenables a __________.

FD_READ

9

closesocket() call signals a __________.

FD_CLOSE

10

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 

11

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 

12

What function is the synchronous counterpart of WSAAsyncSelect( )?

select()

13

What is the name the parameter of the asynchronous notification message, which contains the socket handle.

wParam

14

___________detection means the WinSock DLL detects a socket state at any time after an application calls the asynchronous socket state detection function.

Asynchronous

15

A datagram socket is writable as soon as it is opened, and it is readable as soon as it is _________.

named

16

True or False

Basically the only state most datagram applications need to detect and act upon is the readable state.

True 

17

True or False

Data transmission on a datagram socket is reliable.

False