Make a design for the server. When you get all the details worked out then try coding it. When you have problems,
post the code and your questions about the problems you are having.
Type: Posts; User: Norm
Make a design for the server. When you get all the details worked out then try coding it. When you have problems,
post the code and your questions about the problems you are having.
Sorry, I don't write code for students. Wouldn't that be cheating?
Rework the code into the server and client code you need, make a testing class (what I called a driver) and test it.
I'm not sure trying to rewrite someone else's code would be easier than writing new code.
Make a design and then write the code to do it.
I guess each connection would need its own thread.
Where is the driver for testing? I don't see any code in the server for handling two clients.
Post #8 asked:
There is a lot more needed logic for the server and client. When the first client...
Does it work?
--- Update ---
On the sending side: Open a DataOutputStream, and write the 4 int values (as shown in post #4) and flush the stream.
On the receiving side: read the 4 int values...
Have you made a server that will wait for connections from two clients and set up the streams from the sockets so what is received from one client is sent to the other? Start with that and a simple...
Ok. I'd suggest first writing the classes and methods with a set of testing drivers for clients that sent sample data from one client to the other, displayed what they received and would send sample...
So every message from one client to the other will always contain the following data:
coordinates
Timer value
velocity
A sample message would be these 4 numbers: 123 456 20 33
where 123 and...
What is the design for how the clients and server will communicate?
What will one client send to the other client?
How will the Coordinates, Timer and Velocity values be sent so the other...