I managed to set a read timeout for a C socket with: Now, I want to make this same socket timeouts for send operations. I have found in setsockopt that the proper way to set a timeout for send is quite similar, just replacing SO_RCVTIMEO by SO_SNDTIMEO: My question is if does a successive call of setsockopt o…
Tag: timeout
Linux Socket timeout works on WSL, but not on Ubuntu
I try to run a TCP client without a server. The idea is simply to periodically try to connect. For this, the client tries to connect to port 1500 on localhost. Piece of code: I’ve set it up in Ubuntu 18.04 on WSL. There, the code waits on select for the defined timeout of 2 seconds and returns appropria…
coreutils timeout in a bash script not transparent for the application
I have an issue with executing application via /usr/bin/timeout in a bash script. In this specific case this is a simple python fabric script (fabric version 1.14) In order to install this version of fabric library run: pip install “fabric<2” There is no reproduction with new fabric 2.x. Shell …
The Linux timeout command and exit codes
In a Linux shell script I would like to use the timeout command to end another command if some time limit is reached. In general: But I also want that my shell script exits when the command is failing for some reason. If the command is failing early enough, the time limit will not be reached, and timeout will…
connect() returns “Operation now in progress” on blocking socket?
I have a blocking socket (at least it appears so in following code): And this is from log: Mar 6 10:42:04 tcpclient: fcntl ret=0, ret & O_NONBLOCK = 0 Mar 6 10:42:04 tcpclient: after select fcntl ret=0, ret & O_NONBLOCK = 0 Mar 6 10:42:14 tcpclient: authenticate: error on connect -> Operation now i…