A name service:
In the previous section, we saw how to code a simple server and a simple client. We will now show how we program a more complex client-server system that implements a name service.
A name service provides information about a resource, given the symbolic name of that resource. For example, a name service might keep information about printer names that could then be used to obtain the characteristics of a printer, such as its type, its manufacturer and its speed. The example that we describe here is a name service that returns the email addresses of employees of a company when given their names. For example, the user Egbert Dreistein would be associated with his email address E. [email protected].
The name server will run continuously, accepting a series of requests from one or more clients. It can, however, deal with only one client at any given time - if the server is connected to a client, then any other client requesting to connect will be queued until the first client connection has been closed. The client has a graphical user interface (GUI) to allow the user to input requests and view responses. One of the possible client requests is a message to inform the server that the client is terminating the connection. This allows the server to close the connection to this client and proceed to serve the next client, if any.
First, we will develop the code for the server. In this example, the data is stored in a HashMap object that maps user names to email addresses. In practice, some file-based medium such as a relational database would normally be used.
Java Assignment Help - Java Homework Help
Struggling with java programming language? Are you not finding solution for your A name service homework and assignments? Live A name service experts are working for students by solving their doubts & questions during their course studies and training program. We at Expertsmind.com offer A name service homework help, java assignment help and A name service projects help anytime from anywhere for 24x7 hours. Computer science programming assignments help making life easy for students.
Why Expertsmind for assignment help
- Higher degree holder and experienced experts network
- Punctuality and responsibility of work
- Quality solution with 100% plagiarism free answers
- Time on Delivery
- Privacy of information and details
- Excellence in solving java programming language queries in excels and word format.
- Best tutoring assistance 24x7 hours