diff options
author | Perttu Ahola <celeron55@gmail.com> | 2012-03-11 20:45:43 +0200 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2012-03-11 20:45:43 +0200 |
commit | 618314985d6a632ccfd2001d969d32a5ee6e4ca1 (patch) | |
tree | 94faf77b08206466fb55f80448b02c557e734881 /src/connection.h | |
parent | d1d83d7e7f5e2e7cbef5272eda9c580129e301a3 (diff) | |
download | minetest-618314985d6a632ccfd2001d969d32a5ee6e4ca1.tar.gz minetest-618314985d6a632ccfd2001d969d32a5ee6e4ca1.tar.bz2 minetest-618314985d6a632ccfd2001d969d32a5ee6e4ca1.zip |
Proper handling of failing to bind server socket
Diffstat (limited to 'src/connection.h')
-rw-r--r-- | src/connection.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/connection.h b/src/connection.h index 6d26e2e35..b793f580f 100644 --- a/src/connection.h +++ b/src/connection.h @@ -59,6 +59,14 @@ public: {} }; +class ConnectionBindFailed : public BaseException +{ +public: + ConnectionBindFailed(const char *s): + BaseException(s) + {} +}; + /*class ThrottlingException : public BaseException { public: @@ -424,6 +432,7 @@ enum ConnectionEventType{ CONNEVENT_DATA_RECEIVED, CONNEVENT_PEER_ADDED, CONNEVENT_PEER_REMOVED, + CONNEVENT_BIND_FAILED, }; struct ConnectionEvent @@ -447,6 +456,8 @@ struct ConnectionEvent return "CONNEVENT_PEER_ADDED"; case CONNEVENT_PEER_REMOVED: return "CONNEVENT_PEER_REMOVED"; + case CONNEVENT_BIND_FAILED: + return "CONNEVENT_BIND_FAILED"; } return "Invalid ConnectionEvent"; } @@ -470,6 +481,10 @@ struct ConnectionEvent timeout = timeout_; address = address_; } + void bindFailed() + { + type = CONNEVENT_BIND_FAILED; + } }; enum ConnectionCommandType{ |