_____________ T E A M 1 - H A N G M A N
|/ | Year 4 - Networked Games CA - Hangman 29/11/2017
| ___(")___ 26/11/2017 Updated with report comments
| |_| and image captions
| /^\ Joe O'Regan
| _// \\_ Jason Foley
__|___________ Samantha Marah
This is a group assignment for the 4th year Networked Games module. The group consists of:
Select Server Handling Two Clients
This online text based version of Hangman includes the following features:
- TCP server socket using fork()
- TCP server socket using select(), handles more than one client
- UDP client and server playing for one game
- Modular design with Hangman.h and DrawHangman.h files containing functions common to the different socket versions
- A client that handles asynchronous data inputs from the network / server, and from the keyboard / user correctly
- All server and clients handling a dual TCP/IP stack (IPv4 and IPv6). With the client handling naming and the DNS. (The server can handle connections from both IPv4 and IPv6 clients, but the clients need to be separate programs)
Each folder contains a separate set of sockets, or individual Client and Server that is interchangeable with others. Matching pairs of sockets have Hangman in the folder title, specific Client/Server sockets are specified in the title.
- Original Hangman Listings
- Hangman Modified TCP
- Client Send Recv TCP
- Fork Server TCP
- Hangman Select TCP
- Hangman UDP
- Asynchronous Client TCP
- Hangman Dual Stack TCP
- Asynchronous Client UDP
- Fork Server UDP
The Original Hangman code, unmodified with errors. Using read()
and write()
to communicate
Modified Hangman game, with graphics, coloured text, and functionality to set up sockets, and play the game separated to header files
The Modified Client using send()
and recv()
instead of read() and write() to communicate with the server
A concurrent version of the TCP Server using fork()
, to fork a separate process to deal with each client connection
A concurrent version of the TCP Server using select()
, to handle input from different client connections by one Server process
The Modified Hangman Client and Server using sendto()
and recvfrom()
to communicate between each other in a connectionless state over UDP
The Modified TCP Client that can handle input asynchronously from the socket and file descriptors using the select()
function
The Modified Hangman TCP Client and Server that can handle connections to and from IPv4
and IPv6
addresses
-
Dual stack Server can accept connections from Clients connecting with IPv4 or IPv6 sockets. Using
createDualStackServerSocket()
asockaddr_in6
structure is used to store anIPv6
orIPv4
address (formatted as IPv6) -
The Dual stack client, can take an IPv4 or IPv6 command line parameter and create the appropriate socket, before connecting to the Server. The Client communicates with the Server using
read()
andwrite()
if anIPv4
address is supplied,createClientSocketType()
uses asockaddr_in
address structure, for anIPv6
address asockaddr_in6
address structure is created,createTCPClientDualStack()
uses the IP address parameter, and the port number and callsgetaddrinfo()
creating anaddrinfo
address structure from which the address family can be determined.
A Modified UDP Client that can handle input asynchronously from socket and file descriptors using select()
A concurrent version of the UDP Server using fork()
, to fork a separate process on receiving data with recvfrom to deal with each client connection
For each listing or set of listings, see running and compile instructions in each folder
gcc -o <compiled-app-name> <source-code-file-name>
Ensure dependendent files are in the root directory
No. | File | Description |
---|---|---|
1 | AddressFunctions.h | Intended to hold address functions such as displaying an IP Address and Port number |
2 | CreateTCPSocket.h | Functions to create and handle TCP sockets |
3 | CreateUDPSocket.h | Funcions to create and handle UDP sockets |
4 | DrawHangman.h | Draw the hangman ASCII graphics and display coloured text |
5 | GameState.h | Functionality required to hold state for a game |
6 | HandleErrors.h | Display Error messages, with exit status |
7 | Hangman.h | Functions to play Hangman common to both TCP and UDP |
8 | Socket.h | Socket Functions common to both TCP and UDP |
9 | TCPPlayHangman.h | Functions to play Hangman, modifying the original play_hangman() function using TCP |
10 | UDPPlayHangman.h | Functions to play Hangman, modifying the original play_hangman() function using UDP |
File | Description |
---|---|
1. words | Text file containing the various words the player should guess while playing the game |