On Thu, Mar 01, 2007, richard zhao wrote:

> Hello,all,
> I am doing SSL programming, one question is
> challenging me. what I did on server side is:
> 
>  BIO *servSock=BIO_new_accept(port);
>  if(servSock==INVALID_SOCK2)
> {
>     error handle...
> }
> if(BIO_do_accept(servSock)<=0)
> {
>    error handle...
> }
> if(BIO_do_accept(lstnSock) <= 0)
> {
>    error handle...
> }
> BIO *clntSock=BIO_pop(lstnSock);
> if (clntSock==INVALID_SOCK2)
> {
>    error handle...
> }
> 
> then the server can communicate with client by using
> clntSock.
> 
> during this process, I want to get information about
> IP address of client which is connecting to this
> server by using BIO API to check the IP address if it
> is the one which I want to get. However, I can not get
> any information about IP. could some body be able to
> do me a favor or share some experiences on it.
> thanks.
> 

This should be in openssl-users not openssl-dev.

There is no BIO call to get the IP address. You can however get the underlying
socket fd using BIO_get_fd() and from there get its address using
getpeername() for example.

Steve.
--
Dr Stephen N. Henson. Email, S/MIME and PGP keys: see homepage
OpenSSL project core developer and freelance consultant.
Funding needed! Details on homepage.
Homepage: http://www.drh-consultancy.demon.co.uk
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       openssl-dev@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to