Quiz 4 - Sockets

  • Due No due date
  • Points 100
  • Questions 5
  • Time Limit 15 Minutes

Attempt History

Attempt Time Score
LATEST Attempt 1 6 minutes 100 out of 100
Score for this quiz: 100 out of 100
Submitted Oct 24, 2024 at 7:23pm
This attempt took 6 minutes.
 
Question 1
20 / 20 pts
0 multiple_choice_question   2688130
What method allows you to check for I/O completion on more than one socket?
 
exact_answer none 1867614 1782
Correct!
 
exact_answer none 1867614 4888
 
exact_answer none 1867614 9837
 
exact_answer none 1867614 6952
 
Question 2
20 / 20 pts
0 multiple_choice_question   2688136
What’s the most common type of socket applications?
 
exact_answer none 1867276 366
 
exact_answer none 1867276 7832
Correct!
 
exact_answer none 1867276 8763
 
exact_answer none 1867276 1357
 
Question 3
20 / 20 pts
0 multiple_choice_question   2688135
Why would an application server use the loopback interface to communicate with its own private database?
 
exact_answer none 1867275 236
Correct!
 
exact_answer none 1867275 4918
 
exact_answer none 1867275 9666
 
exact_answer none 1867275 6460
 
Question 4
20 / 20 pts
0 multiple_choice_question   2688131
What does Python’s socket module provide an interface to?
 
exact_answer none 1867272 2842
Correct!
 
exact_answer none 1867272 6752
 
exact_answer none 1867272 3955
 
exact_answer none 1867272 6321
 
Question 5
20 / 20 pts
0 multiple_answers_question   2688132

Consider the following Python script for a simple client:

import socket
HOST = "127.0.0.1"
PORT = 65432
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
    s.connect((HOST, PORT))
    s.sendall(b"Hello, world")
    data = s.recv(1024)
print(f"Received {data!r}")

What does this script do? (Select all that apply.)
 
exact_answer none 1867273 2966
Correct!
 
exact_answer none 1867273 5259
Correct!
 
exact_answer none 1867273 1245
Correct!
 
exact_answer none 1867273 9404
 
exact_answer none 1867273 1079
Quiz Score: 100 out of 100