会话通信程序1

所属分类:网络编程
开发工具:Visual C++
文件大小:534KB
下载次数:58
上传日期:2005-07-28 08:47:31
上 传 者小亮1226
说明:  该实例完成一个服务器端和客户端简单的会话通信过程.要求主机上安装TCP/IP协议,并设定IP.服务器端和客户端使用同一台主机的不同端口号,服务器端使用的端口号为2000,客户端使用的端口号为3000. 服务器端程序先运行,首先初始化Winsock,然后创建套接字,在2000端口上进行绑定,接着在2000端口进行侦听,并进入等待状态.客户端后运行,同样首先初始化winsock,然后创建套接字,接着尝试和服务器端的连接.连接一旦建立,就可以在服务器端和客户端之间进行通信.客户端提示输入一个数字,比如输入50,那么客户端会从"data0"到"data49"发送50个字符串,输入0退出.
(completed an example of the server and client simple oral communication process. Asked on the mainframe installed TCP/IP protocol and set the IP. Servers and clients using the same host of different ports, the use of the server port to 2000, clients use the port number as 3000. server operating procedures first, the first initialization Winsock, and then create socket, in 2000 ports on bonding, then the 2000 port for the interception, and entered the wait state. client after running the same protocols of the first initialization, and then create socket, and then try to server connections. connecting once established, can the server and client communications between. the client suggested the importation of a number, such as the importation of 50, then the client will "data0" to )

文件列表:
会话通信程序1\Server\Debug (0, 2005-07-08)
会话通信程序1\Server\server.dsp (3401, 2005-07-08)
会话通信程序1\Server\server.dsw (537, 2005-07-08)
会话通信程序1\Server\server.ncb (41984, 2005-07-08)
会话通信程序1\Server\server.plg (1146, 2005-07-08)
会话通信程序1\Server\server.cpp (2523, 2005-07-08)
会话通信程序1\Server\server.opt (48640, 2005-07-08)
会话通信程序1\Server (0, 2005-07-08)
会话通信程序1\Client\Debug (0, 2005-07-08)
会话通信程序1\Client\Client.ncb (41984, 2005-07-08)
会话通信程序1\Client\Client.plg (1295, 2005-07-08)
会话通信程序1\Client\Client.dsw (537, 2005-07-08)
会话通信程序1\Client\Client.dsp (3405, 2005-07-08)
会话通信程序1\Client\Client.cpp (2363, 2005-07-08)
会话通信程序1\Client\Client.opt (48640, 2005-07-08)
会话通信程序1\Client (0, 2005-07-08)
会话通信程序1 (0, 2005-07-08)

近期下载者

相关文件


收藏者