To complete this Kata, your task is to implement a program that
- listens on a port for a message containing a simple mathematical task
- calculates the result
- sends the result back to the server
- repeats until message is
The content of the messages are strings with the following structure:
<function> is one of
SUBTRACT. Parameters are integers. There are at least two parameters, but there can be more.
Example server messages are:
The structure of the expected response are:
The correct responses for the example server messages are respectively:
All communication happens through UDP.
To verify your program, start it and then start the script ccc_kata_test.py with Python 2.7 or 2.6. The script expects two command line arguments, which define
- the client port. This is the port your program should listen to for new messages.
- the server port. This is the port on which the test_server listens for responses.
This is how you start the script with port 9000 as client port and port 9001 as server port:
python ccc_kata_test.py 9000 9001
The script will send three messages. If all messages are answered correctly, it will print "successful!", otherwise "unsuccessful!".
The goals of the Kata are to make you comfortable with the socket interface of your chosen language and the structure of a text-based protocol similiar to the protocol used in the Craftsmen-Coding-Contest.