Network Programming: Concurrent Servers

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/17

flashcard set

Earn XP

Description and Tags

A set of flashcards covering multi-process, multi-threaded, and IO multiplexing server models, as well as relevant system calls and best practices for network programming.

Last updated 12:38 AM on 6/18/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

18 Terms

1
New cards

What was the median score reported for assignment two so far?

The median so far is 6363 out of 7575.

2
New cards

When is assignment two officially due?

Thursday at 3PM3PM.

3
New cards

Which system call is used to indicate a server's willingness to accept connections?

The listen system call.

4
New cards

What is the difference between the return values of the listening file descriptor and the connected file descriptor?

The listening file descriptor is used to accept connections, while the accept system call returns a new connected file descriptor for communicating with a specific client.

5
New cards

What are the three approaches discussed for handling multiple clients simultaneously?

1.1. The multi process approach, 2.2. The multi threaded approach, and 3.3. The IO multiplexing approach.

6
New cards

In a multi process server, what must the parent process do to avoid creating zombies?

The parent must reap dead children by calling a function like wait PID.

7
New cards

What is the purpose of the SA restart flag in the SIG action structure?

It ensures that the accept system call automatically restarts itself if it is interrupted by a signal, such as a sick child signal.

8
New cards

Why is it important for the parent process to close its copy of the connected file descriptor after a fork?

Otherwise, the program will never be able to detect end of file on that descriptor, similar to issues encountered with pipes.

9
New cards

Which function is used to retrieve the address details of a port for listening?

get ADR info.

10
New cards

What does the function INET N2A do?

It turns a network byte ordered integer into an ASCII or application representation of an IP address.

11
New cards

What is the function of the d print f call?

It is like f print f, but it takes a file descriptor as its first argument instead of a file pointer.

12
New cards

Which P thread function is used to mark a thread so its resources are reclaimed automatically upon termination?

pthread detach.

13
New cards

What is a significant disadvantage of the multi process approach compared to multithreading?

It is very difficult to share data between processes, requiring the use of pipes or shared memory.

14
New cards

In the IO multiplexing approach with poll, what does the POLLIN event indicate?

It indicates that there is data to read on the file descriptor (or for a listening socket, that a connection request has arrived).

15
New cards

What is the high-performance Linux-specific notification mechanism that handles large numbers of file descriptors more efficiently than poll?

ePoll.

16
New cards

What socket option allows a server to immediately reuse an address after the program is killed?

The SO reuse address socket option.

17
New cards

What specific flag should be used with wait PID in a signal handler to ensure the call returns immediately rather than blocking?

WNOHANG.

18
New cards

Why might a high-performance server terminate itself periodically and restart?

To avoid resource consumption from potential memory leaks.