X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fnet%2Fsocket.cpp;h=67bd38137dbe58eba6d76c51df553d90b4f0d3e3;hb=3ab65d35cfd696002e09768a38f98e6a2e1ade81;hp=85cc9872a0df0a802555e80e63df446a8f568fc8;hpb=647e0e3df1ddb4208492a8c336bf12741f5146c0;p=libs%2Fnet.git diff --git a/source/net/socket.cpp b/source/net/socket.cpp index 85cc987..67bd381 100644 --- a/source/net/socket.cpp +++ b/source/net/socket.cpp @@ -11,8 +11,7 @@ namespace Msp { namespace Net { Socket::Socket(const Private &p): - priv(new Private), - local_addr(0) + priv(new Private) { mode = IO::M_RDWR; @@ -26,8 +25,7 @@ Socket::Socket(const Private &p): } Socket::Socket(Family af, int type, int proto): - priv(new Private), - local_addr(0) + priv(new Private) { mode = IO::M_RDWR; @@ -60,7 +58,7 @@ void Socket::set_inherit(bool i) const IO::Handle &Socket::get_handle(IO::Mode) { // TODO could this be implemented somehow? - throw logic_error("Socket::get_handle"); + throw unsupported("Socket::get_handle"); } const IO::Handle &Socket::get_event_handle() @@ -82,7 +80,7 @@ void Socket::bind(const SockAddr &addr) const SockAddr &Socket::get_local_address() const { - if(local_addr==0) + if(!local_addr) throw bad_socket_state("not bound"); return *local_addr; }