Java client server game with applet

I have to implement a simple tourist client server game in Java Unfortunately, I just started with network programming and encountered some problems in choosing the right solution

Let's say I'm creating a chess game in which two clients can connect to the server and use their username and password for authentication and playback The client must be programmed as an applet (thin client), but I didn't know it should be used as a server

I mean, I've read several different possibilities, such as RMI, socket, servlet, but I still don't know which one suits my needs I'm a little confused because I don't fully understand how to communicate

Should I create an executable server that can run all the time on the server and wait for the player? It seems to me that this is a strange way Or is there a simpler way, for example, I can create a servlet and put it on the Tomcat server so that only any player can run the server? Can the servlet communicate with the applet (client) and vice versa*

I really appreciate some tips

Solution

The Tomcat instance will run anyway, otherwise players cannot connect to it

What you can do is provide a server to start a new game instance when the player connects The server itself must always be running

Technically, I suggest you use anything you feel comfortable with Don't care about performance, but try to start

Therefore, if you already have the knowledge of communication technology, please try to use it Please note these limitations and consider them (e.g. message format, push / pull communication, etc.)

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>