ALL > Computer and Education > courses > university courses > graduate courses > Modern Computer Networking > zstu(2017-2018)class > student homework directory > LUBEGA FRED L20172060208 > TCP/IP Java Socket Programming Project. >
A two-player tic tac toe game Version 0
šŸ‘¤ Author: by lubegalydgmailcom 2018-01-16 17:26:08
We will look at a two-player tic tac toe game network application, written completely from scratch in Java. We will see that we can write this program without any knowledge of the technologies under the hood (which include operating system resources, routing between networks, address look up, physical transmission media, etc.)

The application usesĀ theĀ client-serverĀ paradigm, which is roughly

  1. One program, called theĀ serverĀ blocks waiting for a client to connect to it

  2. A client connects

  3. The server and the client exchange information until they're done

  4. The client and the server both close their connection


The only pieces of background information you need are:

  • Hosts haveĀ ports, numbered from 0-65535. Servers listen on a port. Some port numbers are reserved so you can't use them when you write your own server.

  • Multiple clients can be communicating with a server on a given port. Each client connection is assigned a separateĀ socketĀ on that port.

  • Client applications get a port and a socket on the client machine when they connect successfully with a server.


The two-player tic tac toe game Java application illustrates a server that needs to keep track of the state of a game, and inform each client of it, so they can each update their own displays as shown in this pdf .tictacgame.docx

The code can be downloaded from Tic tac game java code.

 

Please login to reply. Login

Reversion History

Loading...
No reversions found.