diff options
Diffstat (limited to 'cpp/src/IceBT/AcceptorI.cpp')
-rw-r--r-- | cpp/src/IceBT/AcceptorI.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/cpp/src/IceBT/AcceptorI.cpp b/cpp/src/IceBT/AcceptorI.cpp index 89532aee6f1..e24f4aee492 100644 --- a/cpp/src/IceBT/AcceptorI.cpp +++ b/cpp/src/IceBT/AcceptorI.cpp @@ -57,6 +57,10 @@ IceBT::AcceptorI::listen() { try { + if(!_instance->engine()->adapterExists(_adapter)) + { + throw SocketException(__FILE__, __LINE__, EADDRNOTAVAIL); + } _addr = doBind(_fd, _addr); IceInternal::doListen(_fd, _backlog); } @@ -158,12 +162,6 @@ IceBT::AcceptorI::AcceptorI(const EndpointIPtr& endpoint, const InstancePtr& ins ex.str = "invalid address value `" + _adapter + "' in endpoint " + endpoint->toString(); throw ex; } - if(!_instance->engine()->adapterExists(_adapter)) - { - EndpointParseException ex(__FILE__, __LINE__); - ex.str = "no device found for `" + _adapter + "' in endpoint " + endpoint->toString(); - throw ex; - } _fd = createSocket(); IceInternal::setBlock(_fd, false); |