How will my program differ in behavior if I use non-blocking sockets with a select() call as opposed to using blocking sockets with a select() call?
Impact of using select with blocking and non-blocking sockets
8.1k views Asked by DaTaBomB At
2
There are 2 answers
0
alecov
On
select() won't behave differently. read(), write(), accept() and other I/O functions will -- they will never block on non-blocking sockets, while they might block even if select() tells they would not, although this is somewhat rare.
https://stackoverflow.com/a/5352634/259543
Not sure whether this behavior is allowed by POSIX, though.
Related Questions in C
- How to call a C language function from x86 assembly code?
- What does: "char *argv[]" mean?
- User input sanitization program, which takes a specific amount of arguments and passes the execution to a bash script
- How to crop a BMP image in half using C
- How can I get the difference in minutes between two dates and hours?
- Why will this code compile although it defines two variables with the same name?
- Compiling eBPF program in Docker fails due to missing '__u64' type
- Why can't I use the file pointer after the first read attempt fails?
- #include Header files in C with definition too
- OpenCV2 on CLion
- What is causing the store latency in this program?
- How to refer to the filepath of test data in test sourcecode?
- 9 Digit Addresses in Hexadecimal System in MacOS
- My server TCP doesn't receive messages from the client in C
- Printing the characters obtained from the array s using printf?
Related Questions in NETWORK-PROGRAMMING
- "(Reason: CORS header ‘Access-Control-Allow-Origin’ missing)" while trying to access Actix webserver from Wix site
- My server TCP doesn't receive messages from the client in C
- I am currently trying to implement a rudimentary firewall from a video I watched but the nimda worm detection is not working and i do not know why?
- Is there a way to trigger a network buffer flush in Python?
- Redirect outbound traffic to a different port
- Post request response time spikes
- How to connect docker container to vpn site to site
- EADDRNOTAVAIL Node JS
- How to handle Okhttp3 POST Failing after changing location? Roaming issue?
- Why my message doesn't write into the socket when I try to read the response after sending it?
- Networkx Multiple Circular Layouts Combined Together
- trivial socket program failing at accept() with errno 22
- getaddrinfo() returning unexpected results
- JmDNS create() function not working on my device
- What C code will determine the network adapter being used by an open socket?
Related Questions in NONBLOCKING
- Improving Django Application Performance: Comparing Blocking and Non-blocking Implementations
- Create non blocking sockets in Octave
- How to perform a non-blocking write to a USB HID device?
- What is the minimum number of written bytes of a SocketChannel when its key is writable?
- Why is MPI_Bsend() a blocking function?
- Is Python's `print()` function blocking or non-blocking?
- Why this promise never gets resolved?
- What exactly makes a non-blocking socket block? The possible danger of using epoll() in edge-triggered mode
- epoll not receiving `EPOLLIN` signal when server sends data to tcp client
- pure C++ design pattern non-blocking for loop
- Is my code thread-safe? [Java, CAS, money transfer]
- Suspend keyword as redundant with Network Request function in Spring Boot Application
- Virtual thread for reading InputStream from HTTP response
- python request blocks publishing of mqtt messages
- Spring reactive r2dbc - how to loop first query which returns Flux<String> and call second query which returns Flux<Object> in non blocking way?
Related Questions in SELECT-FUNCTION
- Prevent Tkinter askopenfilenames from ordering files
- How to change the value in a select field in react native
- select() returns 0 immediately on non-blocking AF_PACKET socket ignoring timeval
- select( ) is returning positive value only once
- C - How to cycle a socket
- pthread_create only if data is available on socket
- Breaking out of select for no reason
- C - filling TCP socket send buffer
- Knowing which file-descriptors are ready after select() call in C
- Ping packets on raw sockets
- How to get the interface I am connected to
- Impact of using select with blocking and non-blocking sockets
- Non-blocking connect() and EINTR
- select() times out even though there is data in the buffer
- Is there a Windows equivalent for eventfd?
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
The
selectpolling will not behave differently, only the receive/send functionality will differ between blocking/non-blocking sockets.