Python <-> Java TCP Sockets

03-01-05
server.py
Client.java


These 2 files, server.py , and Client.java demonstrate how to communicate between java and python over sockets. The Java client has a receive thread that just waits for something to show up on the socket. The Python server has a seperate thread to process receives from all clients that connect to it.

To demonstrate this, I have created a basic protocol to share COVE information. The messages implemented are SendSpeed, SendBearing, SendTurningRate, and SendUpdate. The format for the protocol is just a simple string. !! is the start of a new message and ##\n is the end. All arguments in the message string are identified by their argument name, followed by '=', followed by the value, followed by ','.

SERVER TO CLIENT

CLIENT TO SERVER