Wednesday, February 26, 2020

Question to answer Assignment Example | Topics and Well Written Essays - 1000 words

Question to answer - Assignment Example Figure 1: Server listening to three clients at port number 1234 Question 2 There are basically two types of socket communication; connection-oriented and connection-less socket communication. Connection oriented socket communication requires handshaking from the participating ends to establish a successful connection. This kind of connection requires bi-directional communication since both the parties need to participate to establish the connection. On the contrary, connection less communication requires no such initial requirements to set up a dedicated connection between the participating ends. Connection-less communication does not require the verification of the presence of the destination. Such connections do not provide effective performance in the presence of less speed and greater interference in the environment. Stream sockets are used for connection oriented socket communication when reliability is essential in the transfer of data and messages. Datagram sockets are used fo r connection less communication when reliability is not crucial. Question 3 A series of steps has to be followed to enable successful communication between the client and the server. The first step involves the creation of the socket by creating an object of the class Socket. The parameters in the creation of the socket define the network protocol that will be created. The second step is binding the socket to a network interface; this is done by specifying a local address and a port number. The third step is to connect to a remote server; it should be verified that the server is in listening state to cater the requests of the clients. After a successful connection, transferring of data can take place by either send or receive functions. After the transfer of data and required operations, it is a good practice to close the socket so that the resource can be freed. Question 4 The socket is used to establish the connection from the client’s side. An object of the socket class is created to communicate with the available server and send requests to it. The server socket is used at the server side to listen to all the objects that want to communicate with the server and send requests. The socket server listens to clients that are bound to the same port address as the server. Question 5 Threads are defined as a set of logic and statements that execute in isolation from each other. According to Shaw (2011), there might be multiple threads in a multithreaded environment where they will be sharing computing resources with each other. Threads enable programs to operate faster and stay more responsive to user input. Each thread is assigned a fraction of the time slice to execute and proceed in its own set of statements and commands. A scheduler has the responsibility of assigning time slices to all the threads. The high level states of threads are: ready, running, waiting and dead. Figure 2: States of threads (eTutorials.org, 2008) Question 6 There are two main me thods of threads that enable smooth execution of all operations and functions; synchronization and scheduling. Synchronization: As stated earlier, multiple threads can exist in a multithreaded environment. The threads have their own registers and stack but they might be sharing some data or resources that would require monitoring for its consistency and accuracy.

Monday, February 10, 2020

Midterm Assignment Example | Topics and Well Written Essays - 500 words - 3

Midterm - Assignment Example The books were, in other words, tampered with, making it difficult to really know what the original books said. However one thing is for sure; Christianity rose during a very chaotic era, a period when the world of Jewish was caught between the heel of an immoral and brutal Roman culture, as well as plagued by groups and movements which not only split it further, but also did so under the pretence of saving Jews. Saint Peter was declared the rock upon which Christ would build His church. He surfed martyrdom under the reign of Nero and crucified, head downwards in 64 AD, claiming he was not valuable to die the same way as Christ did. Peter is traditionally is considered as the 1st bishop of Rome. Saint Paul of Tarsus on the other hand is considered a noteworthy Christianity founder. After his miraculous conversion on his way to Damascus to persecute Christians, Paul started travelling as well as preaching about Christ in the synagogues in Damascus. Paul was a crucial interpreter of the teachings of Christ and most Christians regard him as the most significant disciple of Christ; actually next to Jesus himself. Constantine made an official declaration of freedom of religion and legalized Christianity as well. Theodosius accepted baptism and got healed, and was more susceptibly likely to influence the church and in 391 AD he closed officially all the temples in his empire; forbidding pagan cults and practices. Christianity saved civilization after the collapse of Roman Empire. Roman Empire was split in eastern and western empires disorder and civil war was widespread, there was rebelling from German Barbarians. Constantine, due to this, decided to unite the Roman Empire via a religion that would be politically correct for everybody. Thus Christianity was restated on 25th of December. Julius Caesar was tasked with public entertainment in Roman Empire; a very important