How JustAnswer Works:
  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site. Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.
Ask LogicPro Your Own Question
LogicPro
LogicPro, Computer Software Engineer
Category: Programming
Satisfied Customers: 13281
Experience:  Expert in C, C++, Java, DOT NET, Python, HTML, Javascript, Design.
29751445
Type Your Programming Question Here...
LogicPro is online now

for LOGIC PRO, you will use sockets to write a simple client-server

Resolved Question:

for LOGIC PRO,

you will use sockets to write a simple client-server application using UDP sockets to obtain your homework marks. You should input your student ID number and password ***** the client and if the ID and password ***** a record held by the server, the server will send your coursework marks to you.

The client/server action should proceed as follows:
Client
c1. Connect to server using connectionless communication via a UPD socket.
c2. Read (from socket) and display the prompt message sent (see step s2 in server) by the server.
c3. Input your ID number and password ***** send them to the server. c4.Read (from socket) and display your coursework mark, an error message that is returned by the server (see step s4 in server).
c5. Close the connection


Server
s0. [Initialization] Create a socket on one of the port numbers in the range above 1024.
s1.Wait for a client connection on this UDP socket
s2.When a client connection is accepted, send an acknowledgement as a string of text.
s3. Receive and read the student ID number and password ***** by the client. Check that this student ID and password ***** ***** if not, return an error message.
s4. Find the coursework mark requested and send to the client.
s5. Close the connection to the client and then loop back and wait for another connection.





•You must choose an unused server port number above 1024. For example, choose port 8888.
•The Server application listens on port 8888 and handles the incoming requests. It may consist of several classes, one to listen, accept connections and revert to listening, and one to check whether received ID and password ***** valid. The Server should print diagnostic information on the terminal (no GUI is required), listing the status of the server and details of each connection. For example: Server listening on Port 8888, IP number of Client, Connection accepted. It may be helpful to test your Server using telnet before attempting to connect to the client.
•Write a Client application, which consists of a GUI containing a field to insert the student ID, password ***** a ‘Submission’ button that must be clicked to send it. A 'Quit' button would also be good programming practice.
•Most of you will be running both the client and server on the same machine. Start the server in one window, and then start the client in another window. In the socket, use ‘localhost’ as the name of the machine to connect to.
•Make sure you close every socket that you use in your program. If you abort your program, the socket may still hang around and the next time you try and bind a new socket to the port you previously used (but never closed), you may get an error. Also, please be aware that port number, when bound to sockets, are system- wide values and in the Linux lab other students may be using the port number you are trying to use.

Write a report on the design and implementation of your solution, showing code and results: (i) a class diagram outlining the class structure for your proposed solution. (ii) a set of summary tables describing the fields, constructors and methods for each class. (iii) a print out of the Java source code of your complete program.
Submitted: 3 years ago.
Category: Programming
Expert:  LogicPro replied 3 years ago.
Hi,
Welcome
What is the deadline?
Customer: replied 3 years ago.

i need it by monday night

Expert:  LogicPro replied 3 years ago.
ok
Expert:  LogicPro replied 3 years ago.
Download:
http://www.wikisend.com/download/519380/Client.zip

Unzip to a real folder to get NetBeans project folder

Open NetBeans

Click on file->open project

Navigate to unzipped folder and click open

The project will be shown in left pane (project explorer)

Expand project by clicking [+]

Expand source packages by clicking [+]

Expand default package by clicking [+]

Right click on UDPServer.java and click Run to run server

Right click on ClientMain.java and click Run to run client GUI

If connection is established, you will see the message on client GUI.

You can enter id and password ***** get user informtion from server.

For student id and password, see UDPServer.java

There following id and passwords are defined:

String[] studentIDs = {"W000001", "W000002", "W000003", "W000004", "W000005", "W000006"};
String[] passwords = {"w1", "w2", "w3", "w4", "w5", "w6"};

Password ***** id W000001 is w1 and so on

You can ask me again using "For LogicPro only" at the start of your questions like other customers to get instant answers.

It will ensure that question is for me.

Please bookmark my profile page:

http://www.justanswer.com/homework/expert-logicpro/

so you can come back and ask me a question anytime.

Remember, if for any reason you are unsatisfied with my answer, we can continue the conversation until you’re satisfied and rate my answer as excellent. I can address follow up questions on original requirements at no extra charge and I’m always here to help.

Thank you for using this site!

 


Customer: replied 3 years ago.

thanks. could you please give me an example of what commands to type in terminal window to run the server and client side.

Expert:  LogicPro replied 3 years ago.
All steps are givem im my previous reply.
Here are those again. Follow them precisely

Download:
http://www.wikisend.com/download/519380/Client.zip

Unzip to a real folder to get NetBeans project folder

Open NetBeans

Click on file->open project

Navigate to unzipped folder and click open

The project will be shown in left pane (project explorer)

Expand project by clicking [+]

Expand source packages by clicking [+]

Expand default package by clicking [+]

Right click on UDPServer.java and click Run to run server

Right click on ClientMain.java and click Run to run client GUI

If connection is established, you will see the message on client GUI.

You can enter id and password ***** get user informtion from server.

For student id and password, see UDPServer.java

There following id and passwords are defined:

String[] studentIDs = {"W000001", "W000002", "W000003", "W000004", "W000005", "W000006"};
String[] passwords = {"w1", "w2", "w3", "w4", "w5", "w6"};

Password ***** id W000001 is w1 and so on

You can ask me again using "For LogicPro only" at the start of your questions like other customers to get instant answers.

It will ensure that question is for me.

Please bookmark my profile page:

http://www.justanswer.com/homework/expert-logicpro/

so you can come back and ask me a question anytime.

Remember, if for any reason you are unsatisfied with my answer, we can continue the conversation until you’re satisfied and rate my answer as excellent. I can address follow up questions on original requirements at no extra charge and I’m always here to help.

Thank you for using this site!

Customer: replied 3 years ago.

is there a way i can run them through terminal windows in ubuntu rather than running them through netbeans?

Expert:  LogicPro replied 3 years ago.
yes. You can put them both in same folder
in terminal window, compile and run Server java file
open another terminal window and compile and run cient java file

read:
http://askubuntu.com/questions/145748/how-to-compile-a-java-file
Customer: replied 3 years ago.

i followed the instructions through netbeans but when i right click, RUN is greyed out and it wont let me run anything.


 


i can run them through terminal window in linux but there is no established connection

Expert:  LogicPro replied 3 years ago.
In Netbean, double clic on file to open it in right window. Right click inside server java file and click on run

Now right click in client file and click on run> Make sure you are looking at code
LogicPro and other Programming Specialists are ready to help you
Expert:  LogicPro replied 3 years ago.
Hi again,
Just following up with you to see how everything is going and if you have more questions for me.
You can ask me again using "For LogicPro only" at the start of your questions like you do to get instant answers.
It will ensure that question is for me.
Please bookmark my profile page:
http://www.justanswer.com/homework/expert-logicpro/
so you can come back and ask me a question anytime.
If you need any additional information on this answer, please don't hesitate to ask by clicking on 'Reply to Expert', and I will reply as soon as possible.
I hope you found the information in my answer helpful, and if so, please let me know, here. Thank you!
Thanks very much for using Just Answer!
Best wishes
LogicPro
Expert:  LogicPro replied 3 years ago.
Hi again,
Just following up with you to see how everything is going and if you have more questions for me.
You can ask me again using "For LogicPro only" at the start of your questions like you do to get instant answers.
It will ensure that question is for me.
Please bookmark my profile page:
http://www.justanswer.com/homework/expert-logicpro/
so you can come back and ask me a question anytime.
If you need any additional information on this answer, please don't hesitate to ask by clicking on 'Reply to Expert', and I will reply as soon as possible.
I hope you found the information in my answer helpful, and if so, please let me know, here. Thank you!
Thanks very much for using Just Answer!
Best wishes
LogicPro
Expert:  LogicPro replied 3 years ago.
Hi again,
Just following up with you to see how everything is going and if you have more questions for me.
You can ask me again using "For LogicPro only" at the start of your questions like you do to get instant answers.
It will ensure that question is for me.
Please bookmark my profile page:
http://www.justanswer.com/homework/expert-logicpro/
so you can come back and ask me a question anytime.
If you need any additional information on this answer, please don't hesitate to ask by clicking on 'Reply to Expert', and I will reply as soon as possible.
I hope you found the information in my answer helpful, and if so, please let me know, here. Thank you!
Thanks very much for using Just Answer!
Best wishes
LogicPro