Reader small image

You're reading from  Demystifying Cryptography with OpenSSL 3.0

Product typeBook
Published inOct 2022
PublisherPackt
ISBN-139781800560345
Edition1st Edition
Concepts
Right arrow
Author (1)
Alexei Khlebnikov
Alexei Khlebnikov
author image
Alexei Khlebnikov

Alexei Khlebnikov has more than 20 years of professional experience in IT, where he worked in different roles - software developer, system administrator, DevOps engineer, technical leader, architect and project manager. During those years Alexei worked with many technologies - Security, Artificial Intelligence, Web Development, Embedded, Mobile, and Robotics. Among other companies, Alexei worked in Opera Software on the famous Opera Internet browser. Alexei has always been interested in security. He was one of the maintainers of security-related Opera browser modules, responsible for cryptography, SSL/TLS and integration with OpenSSL. He was also a member of the Security Architects group, responsible for the security of the Opera browser. Now Alexei lives in Oslo, Norway, and works as a senior consultant for Bespoke AS. He is also the leader of the Architects group at his current employer.
Read more about Alexei Khlebnikov

Right arrow

Understanding blocking and non-blocking sockets

Network connections can be established on blocking sockets or non-blocking sockets. The default mode depends on the OS, but for most OSes, it is blocking mode.

In blocking mode, if a program requests an Input/Output (I/O) operation on a socket, the operation must be performed, at least partially, or an error must occur, before the control returns to the program. How can an operation be performed partially? For example, if a program tries to read 100 bytes from a blocking socket, the reading function (for instance, recv()) will only return when it is possible to read at least one byte from the socket – otherwise, an error occurs. If no data is coming from the network, the execution of the current thread of the program will be blocked, meaning that the current thread will wait until some data comes. In some cases, a thread may wait on a blocking socket indefinitely. When attempting to send data, the current thread may block if...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Demystifying Cryptography with OpenSSL 3.0
Published in: Oct 2022Publisher: PacktISBN-13: 9781800560345

Author (1)

author image
Alexei Khlebnikov

Alexei Khlebnikov has more than 20 years of professional experience in IT, where he worked in different roles - software developer, system administrator, DevOps engineer, technical leader, architect and project manager. During those years Alexei worked with many technologies - Security, Artificial Intelligence, Web Development, Embedded, Mobile, and Robotics. Among other companies, Alexei worked in Opera Software on the famous Opera Internet browser. Alexei has always been interested in security. He was one of the maintainers of security-related Opera browser modules, responsible for cryptography, SSL/TLS and integration with OpenSSL. He was also a member of the Security Architects group, responsible for the security of the Opera browser. Now Alexei lives in Oslo, Norway, and works as a senior consultant for Bespoke AS. He is also the leader of the Architects group at his current employer.
Read more about Alexei Khlebnikov