mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Proper handling of failing to bind server socket
This commit is contained in:
parent
d1d83d7e7f
commit
618314985d
4 changed files with 51 additions and 2 deletions
|
@ -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{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue