摘要:
#include <functional> template <typename T> struct Callback; template <typename Ret, typename... Params> struct Callback<Ret(Params...)> { template <t 阅读全文
摘要:
此文档收集了一些java入门时查阅的资料,都是解决过实际问题的帖子,在此留个记录。 maven配置 tomcat配置及eclipse安装 阅读全文
摘要:
本文章收藏了一些亲测过的解决过实际问题的帖子,特此收藏一下,纪念那些走过的坑,可能会帮到你! 阅读全文
摘要:
一、安装nginx
安装带有rtmp模块的nginx服务器(其它支持rtmp协议的流媒体服务器像easydarwin、srs等+Apache等web服务器也可以),此处使用nginx服务器,简单方便。 阅读全文
摘要:
/* Await a connection on socket FD.
When a connection arrives, open a new socket to communicate with it,
set *ADDR (which is *ADDR_LEN bytes long) to the address of the connecting
peer and *ADDR_LEN to the address's actual length, and return the
new socket's descriptor, or -1 for errors.
This function is a cancellation point and therefore not marked with
__THROW. */
extern int accept (int __fd, __SOCKADDR_ARG __addr, socklen_t *__restrict __addr_len); 阅读全文
摘要:
/* 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函数返回的文件描述符 阅读全文
摘要:
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; 阅读全文
摘要:
TCP连接在建立连接后,只要两端主机没有被重启,即使是一个空闲的连接也可以保持连接很长时间,中间路由器可以重启、崩溃,链路可以被挂断再联通。这意味着两个应用进程 阅读全文
摘要:
TCP除了有重传定时器来保证将丢失的数据重传以外,还有一些辅助算法用来协助完成数据的重传。
我们认识到在收到一个失序的报文段时, T C P立即需要产生一个 A C K(一个重复的 A C K)。 阅读全文
摘要:
TCP为了保证数据的完整性采用了许许多多的方法,像启用重传定时器、坚持定时器,通过最大路径发现获取到链路中允许通过的最大数据包大小,还有一些其它的如慢启动、拥塞避免、快速重传等等。 慢启动: 一般通信时,发送方一开始便向网络发送多个报文段,直至达到接收方通告的窗口大小为止。当发送方和接收方处于同一个 阅读全文