Java applet multiplayer spil
Jeg vil gerne lave et applet, online, multiplayer spil i java. Og det skal dermed ligge på en webserver.(jeg har lavet spillet, men det er i vinduer på min egen computer)
Så det skal "bare" laves om til applet og webserver.
I den forbindelse skal der være 2 eller flere applets der skal snakke sammen med serveren.
Mit spørgsmål:
Jeg vil gerne have følgende forklaret:
1) http://www.thatsjava.com/java-socket-programming/231019/
2) http://www.thatsjava.com/java-socket-programming/240446/
-------------------------------------------------------------
1) :
"You will need to read the Network Programming section of the Java Tutorial. You can have a server application running on the same server as the webserver which servers the applet. The java applets can connect to the server and exchange data. The server application will need to be multi-threaded and pass messages between all the client applets."
hvordan gør man det?
2) :
"The limitation with a servlet solution is that the connection is one way from client to server. Thus, your client would need to "poll" the server for updates.
if you use a regular socket connection, then the communication between client and server can be handled asynchronously. Meaning the server can push data to the client without the client first requesting it...
That's the difference. Using Servlets would work, but it will not be acceptable for online games that require quick response as you'd have to poll the servlet too much."
hvordan gør man det?
- hvad er "regular socket connection"?
-------------------------------------------------------------
I forbindelse med at jeg har prøvet at finde en løsning, har jeg kigget lidt på Tomcat webserver og Servlets.
Jeg håber i forstår spørgsmålet.