Overriding ::bind in SecureServerSocket

Please post support and help requests here.
Posts: 4
Joined: 12 Oct 2012, 06:09

Overriding ::bind in SecureServerSocket

Postby wisesteve » 12 Oct 2012, 06:44

I'm using SecureServerSocket and HTTPServer as a simple SSL server. I'd like it to listen on port 443 without having to start it as root. Can't do that, as that's a reserved port.

But I have an alternate implementation of bind() that will allow me to bind to reserved ports, and I'd like to use that without doing something as intrusive as replacing the ::bind() calls in SocketImpl.

I've tried several variants on this...

Code: Select all

SecureServerSocket s;
SocketAddress sa;
// Set up sa here
my_bind_replacement(s.impl().sockfd(), sa);

... and they either fail with "Invalid Socket" or end up re-initialising the socket, so the final file descriptor is different to the one I bound. I've tried inheriting from SecureServerSocket/SecureServerSocketImpl, with little success.

Before I dig deeper, is there an obvious trick to do this that I'm missing?

Return to “Support”

Who is online

Users browsing this forum: No registered users and 3 guests