Client Server Model and Blocking Mode Flashcards Preview

Multi-User Game Programming > Client Server Model and Blocking Mode > Flashcards

Flashcards in Client Server Model and Blocking Mode Deck (20)
Loading flashcards...
1

True or False

A TCP client is connection-oriented.

True

2

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

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

3

True or False

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

False

4

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. server socket name 

5

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.

backlog

6

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 descriptor

7

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

 association

8

True or False

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

True

9

True or False

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

False

10

True or False

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

True

11

True or False

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

True

12

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

recv()

13

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

Server prepares for an association

Client initiates the association

Server completes the association

14

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

accept()

15

True or False

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

True

16

True or False

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

False

17

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

port number

18

What are the five elements included in an association?

protocol

client IP address

client port number

server IP address

server port number

19

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

sockaddr_in

20

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

bind()