04 2020 档案

摘要:/* Give the socket FD the local address ADDR (which is LEN bytes long). */ extern int bind (int __fd, __CONST_SOCKADDR_ARG __addr, socklen_t __len) __THROW; 参数一:调用socket函数返回的文件描述符 阅读全文
posted @ 2020-04-30 15:17 OneHunter 阅读(763) 评论(0) 推荐(0) 编辑
摘要:socket函数原型: /* Create a new socket of type TYPE in domain DOMAIN, using protocol PROTOCOL. If PROTOCOL is zero, one is chosen automatically. Returns a file descriptor for the new socket, or -1 for errors. */ extern int socket (int __domain, int __type, int __protocol) __THROW; 阅读全文
posted @ 2020-04-21 22:44 OneHunter 阅读(382) 评论(0) 推荐(0) 编辑
摘要:TCP连接在建立连接后,只要两端主机没有被重启,即使是一个空闲的连接也可以保持连接很长时间,中间路由器可以重启、崩溃,链路可以被挂断再联通。这意味着两个应用进程 阅读全文
posted @ 2020-04-16 21:31 OneHunter 阅读(763) 评论(0) 推荐(0) 编辑
摘要:TCP除了有重传定时器来保证将丢失的数据重传以外,还有一些辅助算法用来协助完成数据的重传。 我们认识到在收到一个失序的报文段时, T C P立即需要产生一个 A C K(一个重复的 A C K)。 阅读全文
posted @ 2020-04-12 10:22 OneHunter 阅读(1618) 评论(0) 推荐(0) 编辑
摘要:TCP为了保证数据的完整性采用了许许多多的方法,像启用重传定时器、坚持定时器,通过最大路径发现获取到链路中允许通过的最大数据包大小,还有一些其它的如慢启动、拥塞避免、快速重传等等。 慢启动: 一般通信时,发送方一开始便向网络发送多个报文段,直至达到接收方通告的窗口大小为止。当发送方和接收方处于同一个 阅读全文
posted @ 2020-04-07 21:12 OneHunter 阅读(1646) 评论(0) 推荐(0) 编辑