GUIHandler class

GUI->GUIHandler.hpp

This class is define some methods to deal with the GUIs, accept their connections and sending data to them. Everything is take place in the 'update' method.

Author: Aidin Gharibnavaz

Constructors

GUIHandler(int port, WorldHandler *worldP)

Create a socket to listen to the 'port' port. 'worldP' is a pointer to the 'world' object which kept the information about the world. By using this pointer GUIHandler can gain current world state and send it to the GUIs.

Methods

void update()

Accept pending connections and send data to the GUIs.

Private Methods

void acceptIncomingConnection()

Accept a pending connection and add its file descriptor to the list of file descriptors. It will be called by 'update'.