Click here to Skip to main content
15,886,137 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In Windows Server System For example in select model openssl use "SSL_read" function to matching with "recv" function, but on the IOCP modle How can I use openssl function to matching with the "WSARecv" function ? Because of in my program have lot of "WSA***" function so that the openssl BIO function may be can not use, what I should do in this condition?


Thanks for you help.

What I have tried:

UINT nRetVal = WSARecv(socket, &m_wsaInBuffer, 1, &dwIoSize, &ulFlags, &pReadOverlap->m_ol, NULL);

what can i do changed into:

int nRetVal = SSL_read(m_pSsl, m_wsaInBuffer.buf,strlen(m_wsaInBuffer.buf) + sizeof(char));
Posted
Updated 4-Jul-17 23:28pm

1 solution

I wrote an article about this for Windows Developer Magazine back in 2002. You can read it here[^]. The trick is to use a bio pair and to push data through the OpenSSL engine.

You can use a similar design for IOCP based solutions. The trick is to handle your IOCP read completions normally and then push the data into your BIO pair and that routes it through the OpenSSL code and then back to you.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900