摘要
网上Chat是Internet十分普通的一个应用,利用Socket聊天室的基本原理,根据HTML规范,当接收到浏览器的请求后,模仿WWW服务器的响应,将聊天内容发送回浏览器,就像浏览一个很大的页面始终处于页面的连接状态。叙述了WindowsSocket套接口应用,流式套接口、数据报套接口和原始套接口3类套接口的差别,Winsock控件的作用,给出了面向连接套接口应用程序数据流程图。对于分布式环境常用的客户机/服务器模型,客户应用程序向服务器程序请求服务,协议可以是对称的,也可以是不对称的,连接客户机/服务器的服务也可以通过数据报套接口提供。按客户机/服务器模型,应用VB6.0设计了一个Chat软件的窗体和其它模块,并附上服务器端代码例子。
The chat is a very popular application of Internet. In terms of HTML criteria and basic principles of socket chat, when a request of browser is received, the chat contents will be sent back to the browser by simulating the response of WWW server as if browsing a huge Web page is online all the time. The application of Windows Socket, the differences among flow socket, data socket and original socket, and the use of Winsock widgets were described. A data flow chat of the application facing joint socket was given. For the usual client/server model of distribution environment, if a client application program asks server program for service, the protocol can be either symmetrical or non-symmetrical. Service that connects client/server can be provided by data socket. According to the model of client/server, a chat forms and other modules were designed by VB6.0. An example of server port codes was attached.
出处
《辽宁石油化工大学学报》
CAS
2004年第4期60-62,共3页
Journal of Liaoning Petrochemical University