X-Git-Url: http://git.tdb.fi/?p=libs%2Fnet.git;a=blobdiff_plain;f=source%2Fsocket.cpp;h=fcd686f1f24d810fb1eef4a6bc8faf139c841288;hp=decdbeb9e2fd663c05a7e07819a30bdd0ca6e4bb;hb=3970ee9cf7978c462390d49e083deb740d71c6fe;hpb=f59eded7c3e162bbdfc6db424c9badc730017698 diff --git a/source/socket.cpp b/source/socket.cpp index decdbeb..fcd686f 100644 --- a/source/socket.cpp +++ b/source/socket.cpp @@ -77,7 +77,7 @@ void Socket::bind(const SockAddr &addr) int err=::bind(handle, &sa, size); if(err==-1) - throw Exception(format("Unable to bind: %s", strerror(errno))); + throw SystemError("Unable to bind", errno); delete local_addr; local_addr=addr.copy(); @@ -187,7 +187,7 @@ unsigned Socket::do_write(const char *buf, unsigned size) if(errno==EAGAIN) return 0; else - throw Exception(format("Writing to socket failed: %s", strerror(errno))); + throw SystemError("Writing to socket failed", errno); } return ret; @@ -206,7 +206,7 @@ unsigned Socket::do_read(char *buf, unsigned size) if(errno==EAGAIN) return 0; else - throw Exception(format("Reading from socket failed: %s", strerror(errno))); + throw SystemError("Reading from socket failed", errno); } else if(ret==0 && !eof_flag) {