登录
首页 » Visual C++ » client-server

client-server

于 2016-07-11 发布 文件大小:22144KB
0 321
下载积分: 1 下载次数: 16

代码说明:

  多协议文件传输c/s网络应用设计与实现,程序用 TCP/UDP 两个协议模拟多协议服务器。首先服务器端要将两种协议的套接字创建好,并且监听 TCP 端口的连接。必要时使用select函数来进行多连接处理和非阻塞处理。而客户端直接可以按照发送的地址和端口号来进行通讯。 首先要运行服务器端,服务器会监听 TCP 端口。然后运行客户端,根据事先设定好的 IP和端口,就可以进行连接传输数据了。 程序实现的关键步骤: 以TCP协议为例 服务器端: 1.创建套接字;2.绑定端口;3.进入无穷的循环;4.接收请求;5.处理请求;6.应答。 客户端: 1.找到服务器的IP地址和协议的端口号;2.创建套接字;3.确定连接需要任意的,没有使用的端口号允许TCP去选择一个;4.将套接字和服务器连接;5.使用应用层协议和服务器交互;6.关闭连接。 (Multi-protocol file transfer c/s network application design and implementation of programs simulate multi-protocol server with TCP/UDP both protocols. First socket server to create a good two protocols, TCP port and listens for connections. If necessary, use the function to handle multiple connections and non-blocking treatment. And the client can follow directly address and port number to communicate. First run on the server side, the server listens on TCP port. Then run the client, according to pre-configured IP and port, you can connect the data transmission. The key step program implementation: In TCP protocol as an example Service-Terminal: 1. Create a socket 2 bound port 3 enter an infinite loop 4. receiving a request 5. processing requests 6 response. Clients: 1. Locate the server s IP address and protocol port number 2 creates a socket 3 connections need to determine arbitrary, unused port allows TCP to choose a 4 and the socket server connections 5 using appli)

文件列表:

client
......\client
......\......\client.cpp,3961,2016-06-16
......\......\client.vcxproj,3313,2016-06-16
......\......\client.vcxproj.filters,944,2015-06-14
......\......\client.vcxproj.user,143,2015-06-14
......\......\Debug
......\......\.....\client.Build.CppClean.log,1851,2016-06-16
......\......\.....\client.lastbuildstate,81,2016-06-14
......\......\.....\client.log,1262,2016-06-16
......\......\.....\client.obj,192399,2016-06-16
......\......\.....\client.tlog
......\......\.....\...........\CL.read.1.tlog,29374,2016-06-16
......\......\.....\...........\CL.write.1.tlog,404,2016-06-16
......\......\.....\...........\client.lastbuildstate,160,2016-06-16
......\......\.....\...........\link.read.1.tlog,2674,2016-06-16
......\......\.....\...........\link.write.1.tlog,378,2016-06-16
......\......\.....\vc120.idb,732160,2016-06-16
......\......\.....\vc120.pdb,421888,2016-06-16
......\client.sdf,32768000,2016-06-20
......\client.sln,1815,2015-06-14
......\Debug
......\.....\client.exe,72704,2016-06-16
......\.....\client.ilk,493528,2016-06-16
......\.....\client.pdb,1134592,2016-06-16
......\.....\tcp_udp.exe,74752,2016-06-16
......\.....\tcp_udp.ilk,471476,2016-06-16
......\.....\tcp_udp.pdb,929792,2016-06-16
......\.....\test.exe,73728,2016-06-16
......\.....\test.ilk,434920,2016-06-16
......\.....\test.pdb,954368,2016-06-16
server
......\Debug
......\.....\tcp_udp.exe,74752,2016-06-16
......\.....\tcp_udp.ilk,545528,2016-06-16
......\.....\tcp_udp.pdb,1101824,2016-06-16
......\tcp_udp
......\.......\Debug
......\.......\.....\main.obj,161031,2016-06-16
......\.......\.....\server.obj,197094,2016-06-16
......\.......\.....\tcp_udp.Build.CppClean.log,1013,2016-06-16
......\.......\.....\tcp_udp.lastbuildstate,82,2016-06-14
......\.......\.....\tcp_udp.log,1302,2016-06-16
......\.......\.....\tcp_udp.tlog
......\.......\.....\............\CL.read.1.tlog,58560,2016-06-16
......\.......\.....\............\CL.write.1.tlog,1232,2016-06-16
......\.......\.....\............\link.read.1.tlog,2888,2016-06-16
......\.......\.....\............\link.write.1.tlog,496,2016-06-16
......\.......\.....\............\tcp_udp.lastbuildstate,161,2016-06-16
......\.......\.....\tcp_udp.unsuccessfulbuild,0,2016-06-14
......\.......\.....\vc120.idb,953344,2016-06-16
......\.......\.....\vc120.pdb,430080,2016-06-16
......\.......\main.cpp,244,2016-06-16
......\.......\server.cpp,8944,2016-06-16
......\.......\server.h,886,2016-06-16
......\.......\tcp_udp.vcxproj,3453,2016-06-16
......\.......\tcp_udp.vcxproj.filters,1151,2015-06-14
......\.......\tcp_udp.vcxproj.user,143,2015-06-14
......\tcp_udp.sdf,32636928,2016-06-20
......\tcp_udp.sln,888,2015-06-14

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

发表评论

0 个回复

  • SendFileClient
    VC++实现类似于QQ文件传输功能的文件发送与接收程序示例,分为服务端和客户端,客户端首次接收数据,将判断文件包大小,数据包中一定包含完整的数据包结构信息,数据不一定完整;读取数据包的大小,包含数据包结构大小和数据大小,之前接收的数据与现在接收的数据能够构成至少一个完整的数据包,文件接收完毕则设置结束标记,若终止的连接,则弹出窗口告诉用户,对方终止了文件传送。   服务端程序是比较简单的,基本是复制文件数据、判断文件是否传递成功、等待对方收受发送任务或取消发送任务,分包继续发送文件等功能(VC++ implementation is similar to QQ file transfer capabilities to send and receive files program examples, divided into server and client, the client receives the first data packet to determine the file size, the packet must contain the complete information packet structure, the data is not must complete reading packet size, including the size and structure of the data packet size, and previously received data received data can now constitute at least one complete packet, the file has been received then set the mark, if the connection is terminated, the pop-up window telling the user, the other party to terminate the file transfer. Server program is relatively simple, basically copying the file data, to determine whether the file transfer is successful, waiting for the other to accept or cancel the sending task sends tasks, subcontractors continue to send files and other functions )
    2014-06-03 13:50:03下载
    积分:1
  • Client-dotnet
    一个用于客户端和服务器端的客户端的简单程序,C#(one for the client and the server-client simple procedure, C#)
    2013-09-03 12:09:29下载
    积分:1
  • socket
    vc++ 下的socket收发例程,tcp和udp例程(socket vc++)
    2013-11-03 23:06:48下载
    积分:1
  • 多人聊天
    基于TCP/IP的多人聊天程序(包含服务器和客户端)( Chat the procedure based on the TCP/IP multi- people (to contain server and customer end) )
    2004-07-03 23:37:55下载
    积分:1
  • SIO_GET_BROADCAST_ADDRESS
    Get Broacdcast address in C
    2007-08-02 10:00:14下载
    积分:1
  • chat
    局域网聊天,包含语音和视频,是很好的学习资料,值得大家采纳(LAN chat, including voice and video, is a good learning materials, it is worth to adopt)
    2016-12-24 22:09:55下载
    积分:1
  • iperf_win
    Iperf windows版,新手学习用,相当不错.(Iperf windows version, novices to learn, is quite good.)
    2013-04-15 15:31:26下载
    积分:1
  • LiveZilla_3.1.8.6
    免注册QQ/MSN号码,直接在网页上聊天/通话/视频,最佳在线客服.(Live Support)
    2010-05-18 17:35:55下载
    积分:1
  • VB 例序讲解
    说明:  VB 例程序讲解 、局域网聊天程序 二、可以换肤的窗体 三、richtext实现的文本编辑器 四、用OLE实现文件拖放 五、窗体卸载时弹出确认对话框 六、让控件大小随窗体改变而改变 七、拖动无标题栏窗体 八、在打开文件对话框中选择多文件 (VB procedures on cases, two LAN chat program, the Eurocargo Form 3, the realization richtext text editor 4, OLE files with drag-and-drop 5, Form unloading pop confirmation dialog box six, with the size controls Form change of seven, dragging Untitled Form 8 column, in fighting to open a file selection dialog many documents)
    2005-12-08 17:04:27下载
    积分:1
  • Chat
    异步套接字编写的网络聊天室程序,根据孙鑫VC++深入详解的例子改写,使用Visual studio 2008 SP1在Unicode编码环境下编写,可以收发中文字符。(Asynchronous socket program written in Internet chat rooms, according to Sun Xin VC++ depth Detailed examples rewritten using Visual studio 2008 SP1 environment written in Unicode encoding, you can send and receive Chinese characters.)
    2013-11-28 14:44:55下载
    积分:1
  • 696516资源总数
  • 106405会员总数
  • 10今日下载