chang-you-ren8

Results 2 comments of chang-you-ren8

day4中超时处理问题还没有修复吗? 下面这个代码我认为会导致goroutine泄露吧? - 如果超时了,后面没有人会读取called, sent中的内容,导致goroutine一直无法结束。 ```go func (server *Server) handleRequest(cc codec.Codec, req *request, sending *sync.Mutex, wg *sync.WaitGroup, timeout time.Duration) { defer wg.Done() called := make(chan struct{}) sent := make(chan struct{})...

> > day4中超时处理问题还没有修复吗? 下面这个代码我认为会导致goroutine泄露吧? > > > > * 如果超时了,后面没有人会读取called, sent中的内容,导致goroutine一直无法结束。 > > > > ```go > > func (server *Server) handleRequest(cc codec.Codec, req *request, sending *sync.Mutex, wg *sync.WaitGroup, timeout...