-
Notifications
You must be signed in to change notification settings - Fork 557
New issue
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
正常写情况下,判断IsComplete和CloseBlock的时机有问题 #182
Comments
当前有问题 |
最后一个LocalWriteBlock时肯定成立啊,因为最后一个肯定会触发slidingwindow的Notify,然后检查IsComplete |
slidingwindow的Notify是按包的顺序来的,如果最后一个包之前的几个包卡了呢? |
滑动窗口是乱序进顺序出的,时间上最后一个调用Notify的并不一定是文件顺序上的最后一个,但是这时候文件顺序上的最后一个包肯定已经到了。。不知道说明白了没。。确实有点绕== |
想通了。从LocalWriteBlock到SlidingWindow::Add到Notify再到Block::Append这一条链中没有异步调用,这样就没问题了。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
LocalWriteBlock
里,会先调用Block::Write()
将数据包放入sliding window,然后调用IsComplete
判断是不是所有数据包已经都从sliding window中取出,如果是,将会调用CloseBlock
将文件描述符关闭,同步元信息。而实际上,IsComplete
并不一定会在对某一个数据包执行LocalWriteBlock
时成立。The text was updated successfully, but these errors were encountered: