diff options
Diffstat (limited to 'cpp/src/qpid/sys/ssl/SslIo.cpp')
-rw-r--r-- | cpp/src/qpid/sys/ssl/SslIo.cpp | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/cpp/src/qpid/sys/ssl/SslIo.cpp b/cpp/src/qpid/sys/ssl/SslIo.cpp index bbfb703170..92e51a2234 100644 --- a/cpp/src/qpid/sys/ssl/SslIo.cpp +++ b/cpp/src/qpid/sys/ssl/SslIo.cpp @@ -68,32 +68,28 @@ __thread int64_t threadMaxIoTimeNs = 2 * 1000000; // start at 2ms * Asynch Acceptor */ -template <class T> -SslAcceptorTmpl<T>::SslAcceptorTmpl(const T& s, Callback callback) : +SslAcceptor::SslAcceptor(const Socket& s, Callback callback) : acceptedCallback(callback), - handle(s, boost::bind(&SslAcceptorTmpl<T>::readable, this, _1), 0, 0), + handle(s, boost::bind(&SslAcceptor::readable, this, _1), 0, 0), socket(s) { s.setNonblocking(); ignoreSigpipe(); } -template <class T> -SslAcceptorTmpl<T>::~SslAcceptorTmpl() +SslAcceptor::~SslAcceptor() { handle.stopWatch(); } -template <class T> -void SslAcceptorTmpl<T>::start(Poller::shared_ptr poller) { +void SslAcceptor::start(Poller::shared_ptr poller) { handle.startWatch(poller); } /* * We keep on accepting as long as there is something to accept */ -template <class T> -void SslAcceptorTmpl<T>::readable(DispatchHandle& h) { +void SslAcceptor::readable(DispatchHandle& h) { Socket* s; do { errno = 0; @@ -114,10 +110,6 @@ void SslAcceptorTmpl<T>::readable(DispatchHandle& h) { h.rewatch(); } -// Explicitly instantiate the templates we need -template class SslAcceptorTmpl<SslSocket>; -template class SslAcceptorTmpl<SslMuxSocket>; - /* * Asynch Connector */ @@ -134,13 +126,14 @@ SslConnector::SslConnector(const SslSocket& s, boost::bind(&SslConnector::connComplete, this, _1)), connCallback(connCb), failCallback(failCb), - socket(s) + socket(s), + sa(hostname, port) { //TODO: would be better for connect to be performed on a //non-blocking socket, but that doesn't work at present so connect //blocks until complete try { - socket.connect(hostname, port); + socket.connect(sa); socket.setNonblocking(); startWatch(poller); } catch(std::exception& e) { |