#include
int BIO_read(BIO *b, void *buf, int len); int BIO_gets(BIO *b,char *buf, int size); int BIO_write(BIO *b, const void *buf, int len); int BIO_puts(BIO *b,const char *buf);
_B_I_O___g_e_t_s_(_) performs the BIOs "gets" operation and places the data in bbuuff. Usually this operation will attempt to read a line of data from the BIO of maximum length lleenn. There are exceptions to this however, for example _B_I_O___g_e_t_s_(_) on a digest BIO will calculate and return the digest and other BIOs may not support _B_I_O___g_e_t_s_(_) at all.
_B_I_O___w_r_i_t_e_(_) attempts to write lleenn bytes from bbuuff to BIO bb.
_B_I_O___p_u_t_s_(_) attempts to write a null terminated string bbuuff to BIO bb
One technique sometimes used with blocking sockets is to use a system call (such as _s_e_l_e_c_t_(_), _p_o_l_l_(_) or equivalent) to determine when data is available and then call _r_e_a_d_(_) to read the data. The equivalent with BIOs (that is call _s_e_l_e_c_t_(_) on the underlying I/O structure and then call _B_I_O___r_e_a_d_(_) to read the data) should nnoott be used because a single call to _B_I_O___r_e_a_d_(_) 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 _s_e_l_e_c_t_(_) (or equivalent) should be combined with non blocking I/O so successive reads will request a retry instead of blocking.
See _B_I_O___s_h_o_u_l_d___r_e_t_r_y(3) for details of how to determine the cause of a retry and other I/O issues.
If the _B_I_O___g_e_t_s_(_) function is not supported by a BIO then it possible to work around this by adding a buffering BIO _B_I_O___f___b_u_f_f_e_r(3) to the chain.
TBA