Do you have any
experience with networking via Java? If not, some good background here:http://docs.oracle.com/javase/tutorial/networking/index.html
I'll be interested in seeing what folks post as an answer. I'm sure their answers will be more helpful. But no one else has answered yet, and you might find it interesting to poke around with the few things I do know about.
I'm reading an older game programming book by Brackeen (Developing Games in Java), and there is a chapter (chapter 6) on multiplayer. He seems to make a lot of use of JDK 1.4 NIO libraries. The book might be available used, for cheap. I found mine at a local Half-Price books.
I haven't gotten to this chapter yet. Am curious if others think that this approach is still a good one, and what might have taken its place.
I have looked over some code from a friend that made a web-based variant of "Snake"--where the backend uses Java EE Servlets technology. But I don't think Servlets are being used for games very often. The overhead for Servlets is higher than for just adding an NIO layer, both in terms of coding and in what one has to learn in support.