stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
Chapter 12 - Socket Programming Flashcards | StudBud
Explore
/
Chapter 12 - Socket Programming
Chapter 12 - Socket Programming
29 terms
·
StudBud Administration
·
21 plays
Imported from external platform
Flashcards
29 cards
F
Practice quiz
P
Host live
L
Questions
29
Answers
1
What are the socket types that exist in Python based socket programming?
SOCK_UX and SOCK_IT
SOCK_DGRAM and SOCK_STREAM
AF_UNIX and AF_INET
AF_DG and SOCK SM
2
Which library enables network communication in Python?
networking
socket
communication
INET
3
When constructing a TCP server socket in Python, the sequence of function calls is:
socket(), connect()
socket(), listen(), bind(), accept()
socket(), recvfrom(), sendto()
socket(), bind(), listen(), accept()
4
What must you do in Python before opening a socket?
import tcp
import tcp-socket
open socket
import socket
5
A socket statement in python will automatically close the connection if no action is specified
True
False
6
In python programming, we create the IPv4, TCP socket by using create_Socket=
socket(AF_INET, SOCK_STREAM)
socket(AF_INET, SOCK_DGRAM)
socket(AF_INET, SOCK_RAW)
socket(AF_INET, SOCK_RDM)
7
Which is not python socket function?
bind()
connect()
connect_ex()
recvto()
8
On a socket, python sends data as:
UTF 8 encoded text
a String
bytes
integers
9
Who developed Python Programming LanguageWho developed Python Programming Language
Rasmus Lerdorf
Niene Stom
Guido van Rossum
Wick van Rossum
10
Strings need to be _______ before being sent over a Python socket.
encoded
checked for spelling
decoded
encrypted
11
(in python) Can you make a lan from the socket library?
Pssh I don't know.
Yes
Definitely not!
No
12
What happens in Python when the other host closes a socket
recv() returns Nothing
Your program starts crying
recv() returns b''
An exception is thrown
13
Which python library will you use to create a socket in Python?
connection
import
method
socket
14
Strings need to be _______ before being sent over a Python socket.
encrypted
checked for spelling
encoded
decoded
15
A python server socket can only receive data and can not send data back.
False
True
16
The socket library is part of Python's standard library
True
False
17
Which python library will you use to create a socket in Python?
socket
method
import
connection
18
Which are methods normally used with a Python network client?
socket.connect()
socket.listen()
socket.accept()
socket.bind()
19
Which python library will you use to create a socket in Python?
socket
method
connection
import
20
Who made Python programming?
Bill Gates
John Knoll
Guido van Rossumand
Thomas Knoll
21
A python server socket can only receive data and can not send data back.
False
True
22
A python server socket can only receive data and can not send data back.
False
True
23
Which are examples of socket creation in Python?
clientSocket = socket(AF_INET, SOCK_STREAM)
all of the above
serverSocket = socket(AF_INET,SOCK_DGRAM)
clientSocket = socket(AF_INET,SOCK_DGRAM)
24
The Monty Python Programming Institution was the inspiration for the name "Python".
TRUE
FALSE
25
What is the purpose of the socket module in Python?
To manipulate strings and text data
To perform mathematical operations
To create and manage network connections
To work with regular expressions
26
In Python, which method of the
socket
object is used to send data to a server?
socket.listen()
socket.bind()
socket.recv()
socket.send()
27
A step in the creation of a server socket in Python is the "serverSocket.bind((‘’,serverPort))" step.
False
True
28
In Python, which socket function is used to establish a connection with a server?
socket.accept()
socket.bind()
socket.listen()
socket.connect()
29
What are the socket types that exist in Python based socket programming?
SOCK_DGRAM and SOCK_STREAM
SOCK_UX and SOCK_IT
AF_DG and SOCK SM
AF_UNIX and AF_INET