read_write

command
v0.0.0-...-a23e254 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 13, 2020 License: MIT Imports: 5 Imported by: 0

README

组合1 模拟正常的读写请求 组合2 是对一次性读取不完请求数据时的处理 组合3 模拟当 server 读取数据时 client 端主动关闭链接 组合4 模拟 server 读取超时的情况 组合5 模拟 client 向 server 发送大量数据模拟两边OS 协议栈堆满的情景 组合6 是组合5的升级版, client 写入时加上了超时判定

代码来源: https://tonybai.com/2015/11/17/tcp-programming-in-golang/

综上, tcp 因为是双工链接, client 和 server 的读&写都应该加上超时判定, 保持程序的高速处理请求的状态

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL