You may want to bind() your client socket before connect(), but that doesn't always work well.
When you're running out of ephemeral ports, bind(0) will generally Bind: Address Already in Use you, while connect() should still work if you're connecting to different endpoints (so that connection 4-tuple is unique).
PS. no, SO_REUSEADDR doesn't help
network,
linux
alexus27
Apr 26, 2018 12:50
во 2 половине 19 века появляется дарвин. возникают эти идеи отличающиеся от классических. разрыв мозга
(
Read more... )
alexus27
Dec 15, 2017 17:19
Timestamp your output:
ts '[%Y-%m-%d %H:%M:%S]'
It's in
moreutils package.
It also has other cool stuff, like
sponge.
linux
alexus27
Nov 08, 2017 18:34
#!/bin/bash
echo hello
if test -t 1; then
# Stdout is a terminal.
exec >log
else
# Stdout is not a terminal.
npipe=/tmp/$$.tmp
trap "rm -f $npipe" EXIT
mknod $npipe p
tee <$npipe log &
exec 1>&-
exec 1>$npipe
fi
echo goodbye
Read more... )
bash,
linux