Enums, Sockets, Threads Flashcards
Define what an Enumeration is, as well as it’s purpose…
A way of specifying a set of integer constants, each of which is represented by a variable name.
What is the default start value of Enums? What happens if you assign a different integer to the first value?
- If the first number is changed, the following numbers will be be incremented accordingly.
In an enum of 10 members, if the first 5 constants are 0-5 integers, but then the 5th is changes to 88. What will the integer constants of 5 to 10 be?
88,89,90,91,92
Write a small program to give an example of an Enumeration…
…
What does the telnet command do? Give an example of telnet in use…
telnet connects the terminal to a remote server e.g. telnet computerscience.ac.uk 80
Define the roles of sockets on a network…
Sockets enable nodes (hosts) on a network to communication with each other.
In most systems that use sockets, what language is the fundamental low-level socket that peripheral sockets all filter down to developed in?
Most systems have a core C socket, which other sockets filter down to.
What are the 2 sides of a Socket interaction across a network called?
Client Server.
What are the 7 steps that a Server Side socket conducts to interact with a Client Socket?
Create socket; set socket options; Bind listener to port number; Listen; Accept client request; Exchange data; Close connection.
What are the 3 steps that a Client Side socket conducts to interact with a Server socket?
Create socket; Request a connection; Exchange data.
When a Server Socket is listening on a port, what type of process is doing the listening?
Http Daemon process listens for connection on the socket port.
What is a daemon process in Linux?
A background process
Which of the fundamental processes is used to enable data exchange between the 2 sockets?
Pipe
Which command is used to create a pipe between a pair of sockets?
popen( ) -> Pipes between 2 sockets.
With regards to exchanging data, what is the difference between using pipes as opposed to raw sockets?
Using popen( ) opens a buffered stream between sockets. Thus, it’s safer and quicker.