Hi, i am developing a client app with openssl. I use SSL_read and SSL_write
in blocking mode, i just cant figure out something about them, if server
sends me 10 kb and i call SSL_read just once, can i assume that i will
receive all the data at once.

I use simple recv call with that classic approach, should i use SSL_read in
this way?

int read_socket(SOCKET s, void *pBuf, int n)
{
int result;
int index = 0;
int left = n;

while (left > 0)
{
result = recv(s, (char *) pBuf + index , left, 0);
if (result == 0)
return index;
if (result == -1)
return -1;
index += result;
left -= result;
}
return index;
}

Reply via email to