Callback called at state change events.
state: TCPServer.PORT_IN_USE, msg: port
state: TCPServer.CONNECTED, msg: IP address of client
state: TCPServer.LISTENING, msg: port
state: TCPSever.TERMINATED, msg: empty
state: TCPServer.MESSAGE, msg: message received from client