0

Intro: I want to develop simple multiplayer Five in row (Gomoku). Front-end should be done using JavaScript, and back-end in Java.

Basically client and server should exchange pairs of integer numbers and game id. It's easy to do on client side with WebSockets, but...

Question: Is there simple way to process communication on server side, using Sockets and ServerSocket, without embedding Jetty or any other server?

3 Answers 3

3

Since Front-end is javascript it might run in a web browser. To communicate with the server most likely using http, then embedding Jetty and using dwr is the simplest way IMO.

Sign up to request clarification or add additional context in comments.

Comments

2

If you intend to do such thing on a web project, have a look at the DWR project.

Comments

0

WebSockets browser support is poor at the moment.

If you're creating a Web application the mainstream solution for JS-Java communication is Ajax with some JS framework like jQuery or Dojo. It will not require any libs on the server side (unlike DWR) and also you don't need to put any JS stuff on your server if you use CDN.

3 Comments

With the flash fallback this is hardly a problem: github.com/gimite/web-socket-js
Looking at the list of its limitations I would still prefer just plain Ajax...
It's university project. Did not think it is important to mention.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.