I would like to be able to limit bandwidth of tcp connection in my code. This question has some clues, but not exactly what I want. I have tried to hack src code of go standard lib (net/tcp package), using similar approach, but failed. My main idea is to somehow write data from syscall to internal buffer slowly, thus making OS to drop tcp packets.