Operation Modes Flashcards

1
Q

According to your text, what are re-entrant messages?

A

messages your application receives while a blocking operation is outstanding

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

According to the book, what is an advantage of threads?

A

you can create an application that handles many sockets simultaneously and uses blocking sockets

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

According to the book, what is a disadvantage of threads?

A

Any program using them is not as portable to 16-bit Windows.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the four types of timeouts for blocking operations?

A

automatic timeouts

user-settable timeouts

application timeouts

TCP keep-alive timeouts

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the three possible operation modes of Windows Sockets functions?

A

blocking, nonblocking, asynchronous

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is meant by the term fake blocking?

A

Fake blocking means that although your application waits for the network operation to complete the WinSock DLL yields as you wait.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What option is the default for closesocket() that blocks only if you have a blocking socket and set a nonzero timeout by calling setsockopt() to enable the SO_LINGER option?

A

SO_DONTLINGER

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Which socket functions time-out automatically, and are controlled completely by the network system?

a. connect, send, gethostbynature
b. connect, recv, gethostbyname
c. connect, send, gethostbyname
d. connect, recv, gethostbyagebyname

A

c. connect, send, gethostbyname

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Which Window Sockets operation mode, “transfers data quickly, yet remains friendly”?

a. all of them transfer data based upon the current weather conditions
b. Asynchronous
c. Non-Blocking
d. Blocking

A

b. Asynchronous

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What three functions can block forever and have no time limit?

A

recv(), recvfrom(), accept()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What two functions allow an application to determine a timeout value?

A

select() and closesocket()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

__________mode is the “friendliest” but is relatively slow.

A

Blocking

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

___________operation mode is the fastest, but requires the most overhead.

A

Nonblocking

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

A Windows Sockets function returns only when the operation completes in _____________ operation mode.

A

blocking

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

According to your text, which asynchronous function is considerd to be the most significant?

A

WSAAsyncSelect()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What option can be set in setsockopt() to enable a timeout on a stream socket?

A

SO_KEEPALIVE

17
Q

True or False

A blocking function call returns immediately whether or ont the relevant network operation has completed.

A

False

18
Q

True or False

If a non-blocking socket function returns indicating there was success, it may not mean it did exactly what you asked.

A

True

19
Q

True or False

Non-blocking calls wait for operations to complete before returning to the calling application.

A

False

20
Q

True or False

A socket returned from the socket() function operates in nonblocking mode by default.

A

False