Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8056569
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T08:44:50+00:00 2026-06-05T08:44:50+00:00

I have a BIO object which is buffering a SSL connection. How do I

  • 0

I have a BIO object which is buffering a SSL connection. How do I poll the connection to see if i can call a read without blocking?

The OpenSSL website says:

One technique sometimes used with blocking sockets is to use a system call (such as select(), poll() or equivalent) to determine when data is available and then call read() to read the data. The equivalent with BIOs (that is call select() on the underlying I/O structure and then call BIO_read() to read the data) should not be used because a single call to BIO_read() can cause several reads (and writes in the case of SSL BIOs) on the underlying I/O structure and may block as a result. Instead select() (or equivalent) should be combined with non blocking I/O so successive reads will request a retry instead of blocking.

The problem here is that I cannot change the type of the connection as it is made elsewhere. Is there another way to accomplish my goal?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T08:44:51+00:00Added an answer on June 5, 2026 at 8:44 am

    You can probably use fcntl(2)‘s F_SETFL to set the O_NONBLOCK flag on the file descriptor. Since the socket is being used via OpenSSL’s BIO utilities by the time you want to set this flag, it should be fine — the rest of your application cannot make use of the data from the socket until it has passed through the BIO routines.

    Thus I believe that you can change the connection type.

    I see in the bio.h header an API that looks made for your case:

    #define BIO_set_nbio(b,n)       BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL)
    

    though there is the following caveat in the manual:

       BIO_set_nbio() sets the non blocking I/O flag to n. If n is
       zero then blocking I/O is set. If n is 1 then non blocking
       I/O is set. Blocking I/O is the default. The call to
       BIO_set_nbio() should be made before the connection is
       established because non blocking I/O is set during the
       connect process.
    

    Perhaps the underlying BIO interface isn’t expecting to change once the connection is made; it would be worth trying this with the explicit fcntl(2) call yourself — perhaps it’ll all Just Work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a blocking SSL BIO object which I want to send data to.
I have a simple link in a menu <a id=Home href=Amico-Bio-Home-Page></a> to which i
I am working on a project in which I have to develop bio-passwords based
I have a legacy app(HTTP and raw TCP) that uses traditional BIO (blocking IO)
Assuming the following code, i have strange error in my base64 encodings. #include <openssl/bio.h>
-(id)setBigObject:(BigObject *)abc{ self.wl = abc; abc.smallObject = self.smallObject; } I have a abc, which
I have received a X509 certificate (one .cer file), I can decode it, so
I have done a couple research jobs in Bio-informatics and I have used Matlab
I want to pass an object A to a second object B, have B
I have a Model that looks like: class MyModel(Model): name = models.TextField(blank=True, default='') bio

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.