摘要 |
The invention provides an SSL (Secure Sockets Layer) nonblocking communication method and a server therefor/ The SSL nonblocking communication method comprises the following steps of: monitoring a network I/O (Input/Output) event by a server, and registering a read event if the I/O event is a connecting event; if the I/O event is a write event, executing write operation of writing second enciphered data in a buffering region into a network, obtaining a current handshake state according to a preset SSL handshake process and executing corresponding operation according to different handshake states; and if the I/O event is a read event, executing read operation of first enciphered data from the network, writing the first enciphered data into a preset buffering region, obtaining the current handshake state according to the preset SSL handshake process and executing corresponding operation according to different handshake states. According to the SSL nonblocking communication method and the server therefor disclosed by the invention, nonblocking high-performance communication of an SSL protocol can be ensured, the handshake interaction process of the whole SSL protocol can be controlled, related messages in the handshake interaction process are controlled easily, and a plurality of problems oriented to SSL protocol application are solved. |