acceptex
-
The number of posted AcceptEx operations will depend on the type of traffic your server expects .
至于发出多少个AcceptEx才够,就取决于你的服务器程序所期待的通信交通类型。
-
This can be very useful , but it can also lead to problems since the AcceptEx call will not return until data is received , even if a connection has been established .
这样可能是很有用的,但是也可能会引发问题,因为AcceptEx()必须等全部客户端数据都收到了才返回。
-
A high incoming connection rate ( because of short-lived connections or spurts in traffic ) requires more outstanding AcceptEx calls than an application where the clients connect infrequently .
比如,如果进入连接率高的情况(因为连接持续时间较短,或者出现交通高峰),那么所需要守候的AcceptEx当然要比那些偶尔进入的客户端连接的情况要多。
-
To prevent malicious attacks or stale connections , the accepting thread should occasionally check the sockets outstanding in AcceptEx by calling getsockopt and SO_CONNECT_TIME .
要预防此类攻击,接受连接的线程应该不时地通过调用getsockopt()函数(选项参数为SOCONNECTTIME)来检查AcceptEx()里守候的套接字。
-
Of course , you shouldn 't forget to occasionally poll the client sockets used in the AcceptEx calls , using the SO_CONNECT_TIME option to make sure there are no stale connections .
当然,不要忘记不时地轮询AcceptEx()调用中使用的套接字(使用SOCONNECTTIME选项参数)来确保没有恶意超时的连接。
-
Every AcceptEx call requires the creation of a new socket , so it is best to have a separate thread that posts AcceptEx and is not involved in other I / O processing .
每个AcceptEx()调用都需要创建一个新套接字,所以最好有一个独立的线程专门调用AcceptEx(),而不参与其它I/O处理。