Ajit Singh
Ajit Singh

Reputation: 390

Server-Client 2player Game in Java

I am a new one in Java programming i want to know how overall concept of Socket and Server-Client work and how modification in one's system tends to the modification in other's system, As a starter i am making TicTacToe 2 player in java, i had made TicTacToe for Single Player but want some help to make it in multiplayer.I had gone through many question (on this site) before but they only solve some kind of problem but i want a full knowledge that how this all stuff works. Can any one please tell me that how Server and Client do the message passing in Java ??

I want to ask where to write my Game Code so that it get loaded on both the devices and when user make a turn it get displayed into another user's device also...

Upvotes: 0

Views: 423

Answers (1)

Mirko
Mirko

Reputation: 1552

There are many different answers/solutions for the use-case you described.

But never never develop network communication on a low-level layer. There are different solutions (api) to put the data(messages) into higher layers(f.e. HTTP). That enables you to turn your software very easy into a multithreaded and/or multisession-app.

I would prefer in your simple application an implementation with jersey and grizzly. You'll find lot of how-to's with google ("web services jersey grizzly") and here in stackoverflow of course. ;)

Upvotes: 2

Related Questions