HOME
Mcq modul 07
Correct ans
Question 1
/ 1 pts
The term "domain" in a sense used by socket library refers to:

a process which transmits data to another process

  
any top-level Internet domain

Correct!

an environment in which two cooperating processes exchange data
  
any Internet domain


Question 2
/ 1 pts
The regular IP address consists of:
  
6 octets

Correct!
  
4 octets

  
8 octets

  
2 octets


Question 3
/ 1 pts
The getservbyname() function converts:
  
a server name into server IP address

  
a service's name into service's number


a pair consisting of server name and server IP address into canonical name
Correct!

a pair consisting of service's name and protocol name into service number

Question 4
/ 1 pts
The structure defined in the following way reflects the content of a system file named:
struct > {
char *p_name;
char **p_aliases;
int p_proto;
};
  
password

  
services

  
hosts

Correct!
  
protocols


Question 5
/ 1 pts
A client‑server communication model assumes that the connection:
  
is initiated by the server

Correct!
  
is initiated by the client

  
don't have to be established explicitly

  
is initiated by any of the parties


Question 6
/ 1 pts
The listen() function is utilized:
Correct!

at server side to allow the server to receive clients' connections
  
at server side to receive client's requests

  
at client side to receive server's responses

  
at client side to put the client in inactive state


Question 7
/ 1 pts
The bind() function is utilized:
  
in connection less communication model only


in communications models other than connection oriented and connection less

in connection oriented communication model only

Correct!

in both connection oriented and connection less communication models

Question 8
/ 1 pts
The connection‑less communication model uses:
  
DHCP protocol

  
TCP protocol

  
ICMP protocol

Correct!
  
UDP protocol


Question 9
/ 1 pts
The successful invocation of the getaddrinfo() function:
  
is not allowed in MS Windows environment


is not allowed in Unix/Linux Windows environment

Correct!
  
should followed by freeddrinfo() invocation


should followed by appropriate number of free() invocations

Question 10
/ 1 pts
The closesocket() function:
  
is designed for IP6 traffic only


must be used instead of close() on Unix/Linux platforms
Correct!

must be used instead of close() on MS Windows platform
  
is a direct equivalent of close() function


Question 11
/ 1 pts
The term "socket address" in the INET domain refers to:

a pair consisting of IP address and corresponding canonical host name

an equivalent of a canonical host name using the dot notation
  
an equivalent of the IP address

Correct!

a pair consisting of IP address and service number


Question 12
/ 1 pts
The so‑called "network order" is a term describing:
  
a network command

  
an arrangement used to connect network hosts


a sequence in which the server receives client's requests
Correct!

a way in which octects are deployed inside multi octet data

Question 13
/ 1 pts
Which of the following is a proper socket() function header?
  
void socket(int domain, int protocol);

  
FILE *socket(int domain, int type);

  
struct socket *socket(void);

Correct!
  
int socket(int domain, int type, int protocol);


Question 14
/ 1 pts
Using the WinSock, comparing to regular BSD socket:
  
requires additional initializing invocations

  
requires terminating invocations

Correct!

requires additional initializing and terminating invocations
  
is exactly the same


Question 15
/ 1 pts
Which function assures that the following variable's value will be properly deployed inside sockaddr_in structure?
int http = 80;
  
ntohs()

  
ntohl()

  
htonl()

Correct!
  
htons()


Question 16
/ 1 pts
Which of the following typecasts properly sets the sin_addr field of the sockaddr_in structure?
Correct!
  
*((struct in_addr *) hent >h_addr)

  
*((struct in_addr) hent >h_addr)

  
((struct in_addr *) hent >h_addr)

  
((struct in_addr) hent >h_addr)


Question 17
/ 1 pts
The 'backlog' parameter of the listen() function:
Correct!
  
sets the input queue length

  
sets the number of working threads


sets the maximal number of concurrent connections

sets the maximal number of all incoming connections

Question 18
/ 1 pts
The connection‑oriented communication model uses:
  
ICMP protocol

Correct!
  
TCP protocol

  
UDP protocol

  
DHCP protocol


Question 19
/ 1 pts
The MSG_PEEK flag makes the recvfrom() function:
  
wait for data to come

  
return immediately

  
scan received data for specified patterns

Correct!
  
retain received data in input buffers


  1. Modul 01
  2. Modul 02
  3. Modul 03
  4. Modul 04
  5. Modul 05
  6. Modul 06
  7. Modul 07
  8. Modul 08


Question 20
/ 1 pts
The inet_ntop() function:
  
works only with IP protocol only

  
works only with IP6 protocol only

  
doesn't work on INET domain

Correct!
  
works with both IP and IP6 protocols