We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
// internal writeFrame version to support deadline used in keepalive func (s *Session) writeFrameInternal(f Frame, deadline <-chan time.Time, prio uint64) (int, error) { req := writeRequest{ prio: prio, frame: f, result: make(chan writeResult, 1), } select { case s.shaper <- req: case <-s.die: return 0, io.ErrClosedPipe case <-s.chSocketWriteError: return 0, s.socketWriteError.Load().(error) case <-deadline: return 0, ErrTimeout } select { case result := <-req.result: return result.n, result.err case <-s.die: return 0, io.ErrClosedPipe case <-s.chSocketWriteError: return 0, s.socketWriteError.Load().(error) case <-deadline: return 0, ErrTimeout } }
等待在第二个 select 上,这里实际上数据已经在conn上等待发送,conn不关闭最终会将数据发到对端。 而deadline先到来,返回到应用层本次发送失败。应用层选择重发剩余数据,会导致对端数据重复。
可以在第二个 select 的 deadline 这里直接返回本次数据长度吗? len(f.data)
The text was updated successfully, but these errors were encountered:
Sorry, something went wrong.
No branches or pull requests
等待在第二个 select 上,这里实际上数据已经在conn上等待发送,conn不关闭最终会将数据发到对端。
而deadline先到来,返回到应用层本次发送失败。应用层选择重发剩余数据,会导致对端数据重复。
可以在第二个 select 的 deadline 这里直接返回本次数据长度吗? len(f.data)
The text was updated successfully, but these errors were encountered: