-
client-server
多协议文件传输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)
- 2016-07-11 10:19:07下载
- 积分:1
-
cipandiaodu
从键盘输入一组磁盘访问序列,选择三种算法中的一种,输出其磁头移动的总的磁道数(Input from the keyboard sequence of a set of disk access, select one of three algorithms, the total output of the head movement and number of tracks)
- 2011-01-07 21:17:48下载
- 积分:1
-
fonetqer
MFC的多模板使用,一起添加类似Visual的StartPage(More templates using MFC, add together similar Visual StartPage)
- 2017-03-14 13:19:33下载
- 积分:1
-
Socket基本通信
SOCKET界面的编程,TCP程序的实现。(SOCKET interface programming, TCP program implementation.)
- 2017-09-11 12:17:10下载
- 积分:1
-
angel123
霹雳远控源码,完美编译,无错误,上线正常。好东西值得收藏,支持WIN7。(Thunderbolt source remote control, perfect compiler, error-free, normal on-line. The good thing worth collecting support WIN7.)
- 2012-04-03 20:55:47下载
- 积分:1
-
SplashWindow
一个splashwindow的例子,可以当成模板使用的哦谢谢支持(a splashwindow example, can use the template as Oh Thank support)
- 2007-07-03 09:39:26下载
- 积分:1
-
(用)VC调用matlab engine示例
这是教你如何在VC里调用matlab的文档和源程序(The document and source code to tell you how to load matlab engine using VC.)
- 2005-08-05 11:00:20下载
- 积分:1
-
qtstudydoc
QT学习教程,很好用的
差不多所有的程序教材都从Hello 开始,下面就是这个程序的qt版本(good QT course
1#include <QApplication>
2#include <QLabel>
3 int main(int argc, char*argv[])
4 {
5 QApplication app(argc, argv)
6 QLabel*label = new QLabel("Hello Qt!")
7 label->show()
8 return app.exec()
9 }
)
- 2012-03-10 14:46:07下载
- 积分:1
-
QUADTREE地形
说明: 四叉树(lod)实现地形三维可视化的程序,内有代码和数据(quadtree (incomplete) 3D terrain visualization procedures, which have code and data)
- 2005-10-19 19:47:15下载
- 积分:1
-
Equipment_debug
VB写的GPIB通讯例子+源码下载,NI 安捷伦 GPIB 大家可以参考看看。在仪器面板中可选择连接方式、GPIB地址、网络地址,可以发送命令。用了一些控件来美化窗体的按钮。(VB wrote GPIB communications+ source code examples download, NI Agilent GPIB we can take a look. In the instrument panel, optional connection, GPIB address, network address, you can send commands. Used some form of control to beautify the button.)
- 2014-05-09 12:25:19下载
- 积分:1