I am trying to implement Reliable-UDP in golang.
One of the basic features I need to implement is packet-retransmission.
The naive method is as follows:
- send a packet;
- create a timer (also will create a new goroutine) to check if ACK is received before timer fires.
It is simple, but creation a lot of goroutine is NOT FREE. And I do NOT think implementation of packet-retransmission in TCP uses this method.
So, is there a way to callback a function without creating a new goroutine?
I have checked the post from golang-nuts ( https://groups.google.com/forum/#!topic/golang-nuts/ja8j7wQUB-0), and still can not figure out a solution.