BIO_new_accept: How to set ephemeral port and then get port number?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

BIO_new_accept: How to set ephemeral port and then get port number?

Robert Stober
Good Morning,

I'm currently creating a socket that can accept remote connections using
conn = BIO_new_accept(PORT) and then binding that port using
BIO_do_accept(conn).

But what I want is for the system to choose an ephemeral port for me,
and then I want to find out what that port number is.

1. If I pass the integer '0' into BIO_new_accept, will I get an
ephemeral port when I bind the connection? If not how can I do this?

2. Once I get an ephemeral port, how can I find out what port was
assigned?

Thank you,

Robert


Robert Stober
Senior Systems Engineer
Platform Computing, Inc.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [hidden email]
Automated List Manager                           [hidden email]