近来发觉自己看英语没几句就想放弃,感觉这是一个不好的迹象。
Set ServerType to stThreadBlocking to automatically spawn a new thread for each socket connection accepted by the server socket. When ServerType is stThreadBlocking, the execution of the connection thread is suspended while reading or writing until all information has been transferred over the connection. The thread for each connection generates OnClientRead or OnClientWrite events when the server socket needs to read or write.
设置服务端类型为stThreadBlocking能自动为每个被服务器接受的SOCKET产生一个线程。设置服务器类型为stThreadBlocking,当正在读和写时,连接线程会被挂起,直到所有信息被连接传送。当服务端需要读和写时,每一个连接的线程产生OnClientRead或者OnClientWrite事件。
Set ServerType to stNonBlocking to handle all reading and writing over the socket connections asynchronously. When ServerType is stNonBlocking, all client connections are handled in a single execution thread by default. OnClientRead or OnClientWrite events occur when the client socket on the other end of one of the connections tries to send or receive information over the connection.
设置服务端类型为stNonBlocking(非阻塞式),通过SOCKET连接异步处理(不同时)所有读和写操作。当服务端类型被设为stNonBlocking,所有客户端连接在单一一个默认的线程中处理。当另一端客户SOCKET的连接端尝试通过连接去发送或接收信息时触发OnClientRead 或 OnClientWrite 事件发生.
Use a non-blocking socket when the socket needs to synchronize reading and writing with client sockets.
当socket需要和CLIENTsocket同步读和写时使用一个非阻塞的SOCKET。
Note: When ServerType is stThreadBlocking, it is important that the OnClient... event handlers contain thread-safe code.
注意:当服务端设置为stThreadBlocking,onclient...等事件句柄包括线程安全代码是很重要的。
[@more@]来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/341285/viewspace-968059/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/341285/viewspace-968059/