java如何发送信息?
告诉我。
当我调用 Socket.getOutputStream.write(); 时会发生什么?然后 Socket.getOutputStream.flush(); ? 因为当我想发送超过 8162 字节左右时,它只发送可以放置在这个大小中的字节。并且不会发送下一个字节。
请解释一下。
Tell me.
What heppens when I invoke Socket.getOutputStream.write(); then Socket.getOutputStream.flush(); ?
Because when I want to send more than around 8162 bytes It sends only bytes which can be placed in this size. And next bytes aren't sent.
Explain me please.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不做Java,我可能是错的,但我的建议是,Socket 有一个用于传出数据的缓冲区,大约 8162 字节是它的最大大小,超过该数量的数据将从缓冲区中被截断,因此会不被发送
I don't do Java and I may be wrong but my suggestion would be that Socket has a buffer for outgoing data and that approximately 8162 bytes is it's maximum size and that data in excess of that amount would be truncated from the buffer and therefore would not be sent