Overview
Features
Download
Documentation
Community
Add-Ons & Services

Overriding ::bind in SecureServerSocket

Please post support and help requests here.

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
s.init(sa.af());
my_bind_replacement(s.impl().sockfd(), sa);
s.listen();


... 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?
wisesteve
 
Posts: 4
Joined: 12 Oct 2012, 06:09

Return to Support

Who is online

Users browsing this forum: No registered users and 2 guests

cron