Back to Browse

Socket Programming Part - 4 (Blocking vs non blocking sockets) in C/C++

18.0K views
Feb 19, 2020
11:38

This is the playlist of Videos for Socket Programming with C/C++ In this video, I have discussed about the blocking vs non blocking sockets and it's implementation using C/C++. Blocking socket blocks a thread till the call to other end returns but non blocking sockets just put the request at other end and simply returns and doesn't block the thread to execute the next instruction!! ioctlsocket is the function which is used to set the blocking vs non blocking sockets. It takes three arguments. first arg is the socket descriptor which is an integer second arg is the option to let the function know as what kind of option you are going to set for the socket (FIONBIO in our case) third arg is the pointer to the value which will indicate as what kind of socket we want to set (0 is used for blocking and 1 is used for non blocking) I have demonstrated it in my video today. References: https://docs.microsoft.com/en-us/windows/win32/api/winsock/nf-winsock-ioctlsocket http://www.on-time.com/rtos-32-docs/rtip-32/programming-manual/tcp-ip-networking/blocking-and-non-blocking-sockets.htm

Download

0 formats

No download links available.

Socket Programming Part - 4 (Blocking vs non blocking sockets) in C/C++ | NatokHD