登录
首页 » Windows Socket编程 » TCP的客户服务器通信程序 一:程序运行过程 1、运行服务器程序,等待客户端发出请求 2、运行客户端程序,输入客户的IP地址,请求连接 3、若连接成功,服务器端...

TCP的客户服务器通信程序 一:程序运行过程 1、运行服务器程序,等待客户端发出请求 2、运行客户端程序,输入客户的IP地址,请求连接 3、若连接成功,服务器端...

于 2022-06-30 发布 文件大小:15.00 kB
0 47
下载积分: 2 下载次数: 1

代码说明:

TCP的客户服务器通信程序 一:程序运行过程 1、运行服务器程序,等待客户端发出请求 2、运行客户端程序,输入客户的IP地址,请求连接 3、若连接成功,服务器端显示客户的IP地址及端口号;客户端接收文件并保存在d:clientls.txt下,否则,显示错误信息。 二:程序实现原理 发送端:打开文件,逐一读取字符到缓冲区(缓冲区大小为1024),若文件大于1024,则成块发送;若小于,则直接发送。 接受端:与发送端同理。-TCP client-server communication program one : running a process, running the server and wait for the client to issue two requests, the client operating procedures, the importation of customer IP address, link request, if successful connection, the server-client shows the IP address and port number ; the client receives the document and preserve d : client ls.txt, otherwise an error message. 2 : Principle procedures transmitter : open the file, read each character to the buffer (buffer size for 1024), and if the document is greater than 1,024, then sent into pieces; If less, then sent directly. Receivers : Send-the same reason.

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • 696524资源总数
  • 103945会员总数
  • 46今日下载