StudentShare
Contact Us
Sign In / Sign Up for FREE
Search
Go to advanced search...

Question to answer - Assignment Example

Cite this document
Summary
PART 1: General Knowledge of Sockets and Threads Question 1 A socket can be defined as an endpoint of an application program that facilitates the connection between server and clients. Clients may range from one to many. A socket address is a combination of an IP address and a port number…
Download full paper File format: .doc, available for editing
GRAB THE BEST PAPER97.9% of users find it useful
Question to answer
Read Text Preview

Extract of sample "Question to answer"

Download file to see previous pages

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 for 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 methods 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.

...Download file to see next pages Read More
Cite this document
  • APA
  • MLA
  • CHICAGO
(“Question to answer Assignment Example | Topics and Well Written Essays - 1000 words”, n.d.)
Retrieved from https://studentshare.org/family-consumer-science/1412310-question-to-answer
(Question to Answer Assignment Example | Topics and Well Written Essays - 1000 Words)
https://studentshare.org/family-consumer-science/1412310-question-to-answer.
“Question to Answer Assignment Example | Topics and Well Written Essays - 1000 Words”, n.d. https://studentshare.org/family-consumer-science/1412310-question-to-answer.
  • Cited: 0 times

CHECK THESE SAMPLES OF Question to answer

How to prepare yourself for the examination

Checking time to answer the questionThis is of course a stupid Question to answer, because it depends on various factors.... Some of those may be your grasping power, ability to answer the question quickly and correctly, picking which Question to answer first and the most important is your knowledge.... This is of course a stupid Question to answer, because it depends on various factors.... Some of those may be your grasping power, ability to answer the question quickly and correctly, picking which Question to answer first and the most important is your knowledge....
3 Pages (750 words) Assignment

Goals in Life and Importance of Setting Goals

If you've grown up in the inner city, this might be a very difficult Question to answer.... Very few people give much advice, though, on how you should go about establishing those goals.... Some might try to tell you what they should be.... Unfortunately, most of these people take… So, how exactly should one go about setting goals to begin with?...
2 Pages (500 words) Essay

Roman And Greek Art

This is a difficult Question to answer.... The purpose of this essay is to compare the Roman artistic period to the Greek artistic period.... To be exact, my personal view on the two periods will be outlined and three questions will be answered.... … Which artistic period do you prefer---Greek or Roman---and why?...
2 Pages (500 words) Essay

Mozart and Beethoven Musical Heritage

The writer of this paper states that when asked to a few of Mozart's contributions to music, it is a difficult Question to answer due to the fact that he was such a visionary and had such a profound impact on music it is difficult to just pick two of his contributions.... question 3)Sonatas generally begin with an introduction....
1 Pages (250 words) Assignment

One question to answer

The influence of this powerful norm triggers personal decision-making mechanism.... Various medical and dental services around the globe provide family health services with… This articulation is one of the highest valued exercises since everyone needs a home full of health care since we believe that a healthy home leads to a healthy life. Interestingly, a health care Importance of family health services One of the most powerful subunit as per the prevailed experience is the importance of family health services....
1 Pages (250 words) Assignment

The End of Liberalism: Chapter Segment of Book Dissection

The author's purpose in this chapter is to argue that this is the most important Question to answer right now because for so many years of inquiry about what could be the reason for this social chaos, still there is no sufficient answer that can be obtained.... The author's purpose in this chapter is to argue that this is the most important Question to answer right now because for so many years of inquiry about what could be the reason for this social chaos, still there is no sufficient answer that can be obtained....
1 Pages (250 words) Essay

Twelve questions in Management Information System

MIS 290) to Quiz- One-to-Many-Quiz Question to answer Choice- One-to-One-Professor to Class- One-to-Many-Student to Student ID- One-to-one-True-or-False Question to Correct Answer Choice- One-to-One-Quiz Question to Correct Answer Choice- One-to-Onee) Each of the following examples represents either a Horizontal-Market Application, a vertical-Market Application or a one-of-a-kind Application.... or example: A relationship between a Quiz and a question is most likely a One-to-Many relationship—that is, each Quiz may have multiple Questions....
1 Pages (250 words) Assignment

Value of Education to the Hispanic Family

This is a difficult Question to answer since it is lumping all of the Hispanics into one category.... This is a difficult Question to answer since it is lumping all of the Hispanics into one category.... … The paper "Value of Education to the Hispanic Family" is a worthy example of an assignment on education....
1 Pages (250 words) Assignment
sponsored ads
We use cookies to create the best experience for you. Keep on browsing if you are OK with that, or find out how to manage cookies.
Contact Us