Add defines for echo server state machine states. Add place to store current state. Initialise first state and listen. (Currently unused.)

git-svn-id: svn+ssh://oldsvn/home/mlalondesvn/svn/cral@120 3ee9b42a-b53c-0410-a25e-f0b6218d5d5b
master
follower 17 years ago
parent b2ed21239a
commit 11551d3b61

@ -414,6 +414,11 @@ NetworkConnection NetworkInterface::listen(uint16_t port) {
/* ----- EchoServer ------ */ /* ----- EchoServer ------ */
#define ECHO_CONNECT_WAIT 0
#define ECHO_CONNECTED 1
#define ECHO_CLOSE 2
#define ECHO_HALT 3
class EchoServer { class EchoServer {
public: public:
@ -421,12 +426,17 @@ class EchoServer {
private: private:
NetworkConnection _connection; // TODO: Make public? NetworkConnection _connection; // TODO: Make public?
int _state;
}; };
EchoServer::EchoServer(int port) : _connection (NetworkConnection(port)) { EchoServer::EchoServer(int port) : _connection (NetworkConnection(port)) {
/* /*
*/ */
_state = ECHO_CONNECT_WAIT;
_connection.listen(); // TODO: We should be using Network.listen(...) here and in initialisation list.
} }

Loading…
Cancel
Save