deeper-blue / sdp-robot

The robot code for Deeper Blue, an assistive chess-playing robot. Developed for the System Design Project, a 3rd year course offered at the School of Informatics, University of Edinburgh.
2 stars 0 forks source link

Add server object #51

Closed pilif0 closed 5 years ago

pilif0 commented 5 years ago

Adds server object that encapsulates the comms behaviour. This object also takes the HLI instance as a parameter (therefore it doesn't have to know how to instantiate HLI or LLI).

The object listens continually on the socket, waiting for a connection. Once a connection is established, it takes messages and responds to them as before. Once the connection is closed, the server goes back to listening on the socket. At this moment, it has to be terminated by a forced program shutdown.

Fixes #31, #32

pilif0 commented 5 years ago

Not very sure about the self.hli, is it because they're in the same directory so we don't need to import it?

It is because the HLI is now a field of the Server object. See the Server __init__ where it gets set, and run.py where the constructor is called with an HLI instance.