summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/TcpAcceptor.cpp
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2017-09-20 11:05:13 +0200
committerJose <jose@zeroc.com>2017-09-20 11:05:13 +0200
commit7f0816001e085f482f8f9a34b7f8e06435907510 (patch)
tree46807f18b840e1c9816cd9b4aac001c8078d8bce /cpp/src/Ice/TcpAcceptor.cpp
parentFixed Ice/acm Java7 build failure (diff)
downloadice-7f0816001e085f482f8f9a34b7f8e06435907510.tar.bz2
ice-7f0816001e085f482f8f9a34b7f8e06435907510.tar.xz
ice-7f0816001e085f482f8f9a34b7f8e06435907510.zip
Clean C++ exception code to only throw exception types
- Update C++ code to only throw types derived from C++ exception - Update C++ code to use one-shot constructors to create the exceptions Fix bug ICE-7892
Diffstat (limited to 'cpp/src/Ice/TcpAcceptor.cpp')
-rwxr-xr-xcpp/src/Ice/TcpAcceptor.cpp16
1 files changed, 4 insertions, 12 deletions
diff --git a/cpp/src/Ice/TcpAcceptor.cpp b/cpp/src/Ice/TcpAcceptor.cpp
index 643acf96eab..c486707cd14 100755
--- a/cpp/src/Ice/TcpAcceptor.cpp
+++ b/cpp/src/Ice/TcpAcceptor.cpp
@@ -125,9 +125,7 @@ IceInternal::TcpAcceptor::startAccept()
ICE_NULLPTR,
ICE_NULLPTR) == SOCKET_ERROR)
{
- SocketException ex(__FILE__, __LINE__);
- ex.error = getSocketErrno();
- throw ex;
+ throw SocketException(__FILE__, __LINE__, getSocketErrno());
}
assert(_acceptFd == INVALID_SOCKET);
@@ -137,9 +135,7 @@ IceInternal::TcpAcceptor::startAccept()
{
if(!wouldBlock())
{
- SocketException ex(__FILE__, __LINE__);
- ex.error = getSocketErrno();
- throw ex;
+ throw SocketException(__FILE__, __LINE__, getSocketErrno());
}
}
}
@@ -160,18 +156,14 @@ IceInternal::TcpAcceptor::accept()
{
if(_acceptFd == INVALID_SOCKET)
{
- SocketException ex(__FILE__, __LINE__);
- ex.error = _acceptError;
- throw ex;
+ throw SocketException(__FILE__, __LINE__, _acceptError);
}
if(setsockopt(_acceptFd, SOL_SOCKET, SO_UPDATE_ACCEPT_CONTEXT, (char*)&_acceptFd, sizeof(_acceptFd)) ==
SOCKET_ERROR)
{
closeSocketNoThrow(_acceptFd);
_acceptFd = INVALID_SOCKET;
- SocketException ex(__FILE__, __LINE__);
- ex.error = getSocketErrno();
- throw ex;
+ throw SocketException(__FILE__, __LINE__, getSocketErrno());
}
SOCKET fd = _acceptFd;