Professional Documents
Culture Documents
NetworkProgramming MCQ From Lec1-4
NetworkProgramming MCQ From Lec1-4
What is a socket?
✗ - A process controlled by the app developer.
✓ - A hollow part or piece for receiving and holding/transmitting some part or thing.
✓ - A device or point in a wall where you can connect electrical equipment to the power
supply.
What is a API?
✓ - A set of standard function calls that can be used to add Internet communication to
applications.
✗ - A device or point in a wall where you can connect electrical equipment to the power
supply.
✗ - A hollow part or piece for receiving and holding/transmitting some part or thing.
✗ - A process controlled by the app developer.
What is an stream?
✗ - A sequence of characters that flow out of a process to an output source.
✗ - A sequence of characters that flow into a process from an input source.
✓ - is a sequence of characters that flow into or out of a process
What is a socket?
✗ - A process controlled by the app developer.
✗ - A process socket.
✓ - A hollow part or piece for receiving and holding/transmitting some part or thing.
✗ - A device or point in a wall where you can connect electrical equipment to the power
supply.
What is a socket?
✗ - A door between an application process and the HTTP transport protocol.
✓ - door between application process and end end-transport protocol (UDP or TCP)
✗ - A door between an application process and the UDP transport protocol.
✗ - A door between an application process and the IP transport protocol.
What is a socket?
✗ - A device or point in a wall where you can connect electrical equipment to the power
supply.
✓ - A hollow part or piece for receiving and holding/transmitting some part or thing.
✗ - A process socket.
✗ - A process controlled by the app developer.
What is the purpose of a server socket?
✗ - To enable BSD compliant communication over TCP/IP.
✗ - To provide reliable transfer of bytes from one process to another.
✓ - To create a socket and listen for incoming connection requests from clients.
✗ - To establish a dedicated connection between the source and destination end nodes.
--------------------------------------------------------------------------------------------------------
Lec 2
What does the BSD server do?
✗ - Closes an existing socket and releases a socket descriptor
✗ - Establishes a connection between the endpoints on stream sockets
✗ - Retrieves the address of the peer to which a socket is connected
✓ - Creates a socket, attaches it to a port, and listens for incoming connection requests
What function is used to handle all protocol related data in the Net_Config_TCP.h
configuration file?
✗ - init()
✗ - net_initialize()
✓ - net_main()
✗ - net_main_thread()
What does the TCP protocol do with the data being sent?
✓ - Encapsulates it into a TCP packet and sends it to the remote peer
✗ - Converts it into HTTP requests
✗ - Sends it as is without encapsulation
✗ - Converts it into UDP packets
What happens if a TCP packet is not acknowledged within the timeout period?
✗ - The connection is closed
✗ - The packet is dropped
✗ - The packet is sent to a different destination
✓ - The same packet is resent
In the Java client (TCP) example, what is the purpose of the BufferedReader inFromUser?
✗ - To write output to the user
✗ - To read input from the server
✓ - To read input from the user
✗ - To write output to the server
In the Java client (TCP) example, what is the purpose of the DataOutputStream outToServer?
✗ - To receive data from the server
✗ - To read input from the user
✓ - To send data to the server
✗ - To write output to the user
In the Java server (TCP) example, what is the purpose of the ServerSocket welcomeSocket?
✗ - To create an input stream
✓ - To create a welcoming socket at a specific port
✗ - To create an output stream
✗ - To create a client socket
In the Java server (TCP) example, what is the purpose of the BufferedReader inFromClient?
✗ - To read input from the server
✓ - To read input from the client
✗ - To write output to the client
✗ - To write output to the server
What is TCP?
✗ - Transport Control Protocol
✗ - Transmission Control Port
✗ - Transport Control Port
✓ - Transmission Control Protocol
What does TCP do if data does not reach the final destination due to errors or data
corruption?
✗ - Discards data
✗ - Compresses data
✗ - Encrypts data
✓ - Retransmits data
What is the process of opening a TCP connection called?
✗ - Active close
✓ - Passive open
✗ - Active open
✗ - Passive close
What does the TCP protocol encapsulate the data into before sending it to the remote peer?
✗ - HTTP packet
✗ - UDP packet
✗ - FTP packet
✓ - TCP packet
What does TCP do if a packet is not acknowledged when the timeout expires?
✓ - Resends the same packet
✗ - Closes the socket
✗ - Drops the connection
✗ - Sends a different packet
What happens if a TCP packet is not acknowledged within the timeout period?
✓ - The same packet is resent
✗ - The packet is fragmented
✗ - The connection is closed
✗ - The packet is discarded
What is the maximum number of bytes in the TCP segment's data field?
✓ - Maximum Segment Size
✗ - Receive Window Size
✗ - Retry Timeout
✗ - Number of Retries
Lec 5
What does a socket provide?
✗ - A method for sending emails
✗ - A protocol for web browsing
✓ - An abstraction for interprocess communication
✗ - A way to transfer files
What is a socket?
✓ - The services provided (often by the operating system) that provide the interface between
application and protocol software
✗ - A type of network function
✗ - A type of network API
✗ - A type of network protocol