2 Replies Latest reply: Jun 7, 2008 9:28 PM by 807591 RSS

    Advanced Client Server Application

    807591
      Hi friends.I'm working on a client server application with java.It's about a game which can play beetven two computer.But it won't be so easy.Players
      can play game and at the same time talking to each other.Before I did a lot of game in java.I used a serversocket for server and did another things.I used a OBJECTOUTPUTSTREAM to write the moves of one player to another and take it with OBJECTINPUTSTREAM.In this application I must use two OBJECTOUTPUTSTREAM and OBJECTINPUTSTREAM.I'll send the player' move with One of them and I'll send the communication message with another.But in this situations first of OBJECTINPUTSTREAM lock the program
        • 1. Re: Advanced Client Server Application
          807591
          I don't see the need to have separate communication channels, one for chat and one for the game. If you have a single one, the first step on the reader side would be to ask: what have I just read? If it's a chat message do one thing with it, and if it's a game move do another.

          I'm not saying you couldn't solve this problem using a separate pair of communication channels, but I think the other approach is simpler.
          • 2. Re: Advanced Client Server Application
            807591
            I'll go further than that. I'd say that these days, any time you have any kind of client/server application, the first question you should ask is, is there any pressing reason why we can't just use a web server for the server do all communication over HTTP using a textual serialization mechanism like XML and preferably using REST?

            The documentation and infrastructure for this stuff is so extensive these days, and the potential for repurposing is so great, that going any other way without a good reason is a waste of effort. Even if HTTP/REST/XML isn't an exact fit, it can still be worth it (at least for prototyping) just for the convenience.