Client Server Model and Blocking Mode Flashcards

1
Q

True or False

A TCP client is connection-oriented.

A

True

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

What 3 things does a socket name for TCP/IP consist of?

A

A socket name for TCP/IP consists of the IP address and port number, as well as the protocol.

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

True or False

The server initializes the socket address structure and calls the accept() function to name its socket.

A

False

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

Which of the following is required to create a valid socket association for a TCP connection?

a. server socket name
b. none of these are correct
c. client socket name
d. both a client socket and a server socket name

A

a. server socket name

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

The _________ parameter is the number of incoming connection requests you want the stack to queue while you process connection(s) your server has already accepted.

A

backlog

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

What is the proper name of the object returned, when you open a socket using the socket( ) function?

a. a handle
b. a beeping noise
c. a descriptor
d. a socket

A

a descriptor

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

When a server socket and a client socket successfully connect, their two names combine to form what is known as a(n) __________________.

A

association

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

True or False

One difference between sendto() and recvfrom() is the content of the sockaddr parameter.

A

True

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

True or False

A client is required to name its socket just like a server.

A

False

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

True or False

For two sockets to communicate as client and server they must have the same socket types.

A

True

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

True or False

A server must name its socket to allow the client to find it on the network.

A

True

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

Name one of the two functions that are used to obtain data from a sending client or server.

A

recv()

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

What are the three steps involved in combining the two socket names that form the association?

A

Server prepares for an association

Client initiates the association

Server completes the association

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

The _________ function returns a new socket for a newly created connection after accepting a pending connection request from a listening socket.

A

accept()

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

True or False

When using a TCP socket, you can’t use the send() function unless you have had a successful connect() call.

A

True

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

True or False

Closing a socket is the simplest operation for a connected TCP socket.

A

False

17
Q

In order to properly setup the socket address information, you must provide the family, the server IP address, and the _________.

A

port number

18
Q

What are the five elements included in an association?

A

protocol

client IP address

client port number

server IP address

server port number

19
Q

Which structure is instantiated to setup up the socket address information for a server or client socket?

A

sockaddr_in

20
Q

Which function names the local socket with the values in the sockaddr_in structure?

A

bind()