X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fnet%2Fsocket.h;h=2e736e9a21d04ffaac1f77a704ae50f3f4ed056b;hb=5afa6e0e07b20ef58d262d69d96971df9a4be71f;hp=fe5c605049f84ab8396e11f49d0ceda1a3fe032c;hpb=647e0e3df1ddb4208492a8c336bf12741f5146c0;p=libs%2Fnet.git diff --git a/source/net/socket.h b/source/net/socket.h index fe5c605..2e736e9 100644 --- a/source/net/socket.h +++ b/source/net/socket.h @@ -1,6 +1,7 @@ #ifndef MSP_NET_SOCKET_H_ #define MSP_NET_SOCKET_H_ +#include #include #include #include "constants.h" @@ -9,11 +10,10 @@ namespace Msp { namespace Net { -class bad_socket_state: public std::logic_error +class bad_socket_state: public invalid_state { public: - bad_socket_state(const std::string &w): std::logic_error(w) { } - virtual ~bad_socket_state() throw() { } + bad_socket_state(const std::string &w): invalid_state(w) { } }; @@ -50,6 +50,7 @@ public: users of the address. */ void bind(const SockAddr &); + bool is_bound() const { return local_addr; } const SockAddr &get_local_address() const; void set_timeout(const Time::TimeDelta &);