completed an example of the server and client simple oral communication process....
代码说明:
该实例完成一个服务器端和客户端简单的会话通信过程.要求主机上安装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 import
下载说明:请别用迅雷下载,失败请重下,重下不扣分!