Skip to content
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

不知道是不是勘误 #3

Closed
YaoGuangyuan opened this issue Feb 27, 2019 · 1 comment
Closed

不知道是不是勘误 #3

YaoGuangyuan opened this issue Feb 27, 2019 · 1 comment

Comments

@YaoGuangyuan
Copy link

前几天买了您的书,把socket讲的通俗易懂,分析了网络通信是遇到问题的解决方案,最喜欢的是图表。

另外本人发现一处勘误,不知道是不是我理解错了。在129页 图4-49那里,移动了数据,应该writeInx之后数据为空,可是印刷上却是4和5,不知道是我理解问题,还是勘误。

@YaoGuangyuan
Copy link
Author

作者回复:
hi,此处书上是对的,表述可能有些不严谨。说到“移动了数据”其实在MoveBytes方法中用到的是Array.copy,也就是将原先第3-5位的数据覆盖到1-3位。因为复制是个消耗的操作,为了让复制的数据量最小,我们只复制3-5位而不是整个缓冲区。所以复制后缓冲区里的4-5位保持不变。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant