请帮我P个图,只水豆留下的疤图片图片中的男的 其他人全给我弄走,文字也弄走

C/C++(159)
网络(200)
Introduction to Programming with UDT
The prerequisite knowledge for using UDT is sound experience on C++ and socket programing. This is enough to use UDT in distributed applications. If you are familiar with computer networking, you may find UDT more powerful.
UDT is a C++ library, which has almost identical routines as the BSD socket APIs. Using UDT in a C++ program is very straightforward. In fact, you may easily modify your existing code from TCP to UDT.
Because of the similarity between UDT API and BSD socket API, UDT defines its own namespace UDT to differentiate the UDT APIs from the regular socket APIs. A qualifier of UDT:: should be put before the UDT socket call. UDTSOCKET is a data type to describe a
UDT socket. For a complete UDT structures and constant definitions, please see Reference:UDT Structures. For a complete description of UDT socket APIs, please see Reference:UDT Functions.
For those socket APIs that does not involve with a socket descriptor, e.g., inet_pton, they are not wrapped by UDT API, and the applications should continue to use the original functions. For those socket APIs or options not appropriate to UDT, e.g., certain
TCP options, they are simply not available in UDT API.
For example, using BSD socket, you write:
int s = socket(AF_INET, SOCK_STREAM, 0);
Its counterpart in UDT is like this:
UDTSOCKET u = UDT::socket(AF_INET, SOCK_STREAM, 0);
UDT API is thread-safe. UDT sockets can be shared by multiple threads and UDT API on the same socket can be made concurrently. However, because of its application level nature, UDT sockets cannot be shared among processes. That is, a UDT socket created in one
process cannot be used in another process.
If you use a programming language other than C++, you may need to write certain wrapper for the UDT C++ API. For example, you may use &extern C& to wrap UDT API in C; there are also ways to call C++ API in Java.
To use UDT in a C++ application:
#include &udt.h&
Library (depending on platforms)
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:994802次
积分:14659
积分:14659
排名:第609名
原创:251篇
转载:1577篇
评论:25条
(15)(15)(73)(34)(33)(54)(70)(68)(59)(76)(55)(47)(29)(24)(65)(30)(24)(37)(24)(33)(41)(61)(75)(45)(41)(27)(41)(49)(32)(31)(39)(64)(10)(65)(39)(34)(30)(33)(27)(20)(23)(20)(24)(19)(15)(11)(7)(1)(3)(1)(3)(2)(7)(8)(5)(2)(4)(1)C/C++(159)
网络(200)
Hello World!
In this section we will introduce the simplest UDT program that can transfer data in high performance.
This simple &Hello World!& example includes a server program and a client program just like any socket programming tutorial. These are the simpler version of the appserver and appclient examples in ./app directory.
To compile, use&gcc -o server server.cpp -I&-L&-ludt -lstdc++ -lpthread. For more details, please refer to the Makefile in&./app&directory.
UDT server example
#include &arpa/inet.h&
#include &udt.h&
#include &iostream.h&
int main()
UDTSOCKET serv = UDT::socket(AF_INET, SOCK_STREAM, 0);
sockaddr_in my_
my_addr.sin_family = AF_INET;
my_addr.sin_port = htons(9000);
my_addr.sin_addr.s_addr = INADDR_ANY;
memset(&(my_addr.sin_zero), '\0', 8);
if (UDT::ERROR == UDT::bind(serv, (sockaddr*)&my_addr, sizeof(my_addr)))
&&cout && &bind: & && UDT::getlasterror().getErrorMessage();
&&return 0;
UDT::listen(serv, 10);
sockaddr_in their_
UDTSOCKET recver = UDT::accept(serv, (sockaddr*)&their_addr, &namelen);
char ip[16];
cout && &new connection: & && inet_ntoa(their_addr.sin_addr) && &:& && ntohs(their_addr.sin_port) &&
char data[100];
if (UDT::ERROR == UDT::recv(recver, data, 100, 0))
&&cout && &recv:& && UDT::getlasterror().getErrorMessage() &&
&&return 0;
cout && data &&
UDT::close(recver);
UDT::close(serv);
This simple server tries to bind itself at port 9000. If succeed, it listens at port 9000 and accepts a client and then reads a string.
UDT client example
#include &iostream&
#include &udt.h&
#include &arpa/inet.h&
using namespace UDT;
int main()
UDTSOCKET client = UDT::socket(AF_INET, SOCK_STREAM, 0);
sockaddr_in serv_
serv_addr.sin_family = AF_INET;
serv_addr.sin_port = htons(9000);
inet_pton(AF_INET, &127.0.0.1&, &serv_addr.sin_addr);
memset(&(serv_addr.sin_zero), '\0', 8);
// connect to the server, implict bind
if (UDT::ERROR == UDT::connect(client, (sockaddr*)&serv_addr, sizeof(serv_addr)))
&&cout && &connect: & && UDT::getlasterror().getErrorMessage();
&&return 0;
char* hello = &hello world!\n&;
if (UDT::ERROR == UDT::send(client, hello, strlen(hello) + 1, 0))
&&cout && &send: & && UDT::getlasterror().getErrorMessage();
&&return 0;
UDT::close(client);
The client side connects to the local address (127.0.0.1) at port 9000, and sends a &hello world!& message.
Note that in this &Hello World!& example the UDT::send and UDT::recv routines should use a loop to check return value. However, since the string length is very small and can be hold in one packet, we omit the loop part in order to give a simpler example.
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:994804次
积分:14659
积分:14659
排名:第609名
原创:251篇
转载:1577篇
评论:25条
(15)(15)(73)(34)(33)(54)(70)(68)(59)(76)(55)(47)(29)(24)(65)(30)(24)(37)(24)(33)(41)(61)(75)(45)(41)(27)(41)(49)(32)(31)(39)(64)(10)(65)(39)(34)(30)(33)(27)(20)(23)(20)(24)(19)(15)(11)(7)(1)(3)(1)(3)(2)(7)(8)(5)(2)(4)(1)>> udt4可靠的udp,转载人家的代码,用于交流思想和知识。
udt4可靠的udp,转载人家的代码,用于交流思想和知识。
所属分类:
下载地址:
udt.sdk.4.4.win32.zi文件大小:508.02 kB
分享有礼! 》
请点击右侧的分享按钮,把本代码分享到各社交媒体。
通过您的分享链接访问Codeforge,每来2个新的IP,您将获得0.1 积分的奖励。
通过您的分享链接,每成功注册一个用户,该用户在Codeforge上所获得的每1个积分,您都将获得0.2 积分的分成奖励。
udt4可靠的udp,转载人家的代码,用于交流思想和知识。-udt,for connector-accepter udp program.
Sponsored links
源码文件列表
温馨提示: 点击源码文件名可预览文件内容哦 ^_^
3.90 kB01-22-09 12:57
appclient.exe76.00 kB01-22-09 14:28
3.52 kB01-22-09 12:57
appserver.exe76.00 kB01-22-09 14:28
1.65 kB01-22-09 12:57
892.00 B01-22-09 12:57
2.13 kB01-22-09 12:57
recvfile.exe68.00 kB01-22-09 14:28
2.64 kB01-22-09 12:57
sendfile.exe68.00 kB01-22-09 14:28
udt.dll456.00 kB01-22-09 14:28
3.22 kB01-22-09 12:57
4.54 kB01-22-09 12:57
5.73 kB01-22-09 12:57
1.48 kB01-22-09 12:57
2.62 kB01-22-09 12:57
4.12 kB01-22-09 12:57
2.12 kB01-22-09 12:57
4.67 kB01-22-09 12:57
1.43 kB01-22-09 12:57
565.00 B01-22-09 12:57
3.28 kB01-22-09 12:57
331.00 B01-22-09 12:57
1.87 kB01-22-09 12:57
2.52 kB01-22-09 12:57
2.67 kB01-22-09 12:57
6.93 kB01-22-09 12:57
2.58 kB01-22-09 12:57
3.49 kB01-22-09 12:57
3.13 kB01-22-09 12:57
3.55 kB01-22-09 12:57
769.00 B01-22-09 12:57
4.07 kB01-22-09 12:57
3.42 kB01-22-09 12:57
3.10 kB01-22-09 12:57
4.60 kB01-22-09 12:57
2.22 kB01-22-09 12:57
2.47 kB01-22-09 12:57
1.37 kB01-22-09 14:15
7.25 kB01-22-09 12:57
4.18 kB01-22-09 12:57
4.82 kB01-22-09 12:57
2.65 kB01-22-09 12:57
3.16 kB01-22-09 12:57
1.95 kB01-22-09 12:57
2.74 kB01-22-09 12:57
3.82 kB01-22-09 12:57
2.73 kB01-22-09 12:57
2.15 kB01-22-09 12:57
1.92 kB01-22-09 12:57
2.53 kB01-22-09 12:57
326.00 B01-22-09 12:57
1.38 kB01-22-09 12:57
1.01 kB01-22-09 12:57
ix_book.gif122.00 B01-22-09 12:57
ix_down.gif123.00 B01-22-09 12:57
ix_end.gif63.00 B01-22-09 12:57
ix_endm.gif88.00 B01-22-09 12:57
ix_endp.gif91.00 B01-22-09 12:57
ix_leaf.gif118.00 B01-22-09 12:57
ix_line.gif63.00 B01-22-09 12:57
ix_link.gif134.00 B01-22-09 12:57
ix_list.gif65.00 B01-22-09 12:57
ix_listm.gif89.00 B01-22-09 12:57
ix_listp.gif92.00 B01-22-09 12:57
ix_open.gif125.00 B01-22-09 12:57
ix_space.gif54.00 B01-22-09 12:57
ix_up.gif125.00 B01-22-09 12:57
1.88 kB01-22-09 12:57
20.99 kB01-22-09 12:57
1.54 kB01-22-09 12:57
179.00 B01-22-09 12:57
1.22 kB01-22-09 12:57
44.27 kB01-22-09 13:02
7.96 kB01-22-09 12:57
13.42 kB01-22-09 12:57
8.68 kB01-22-09 12:57
6.71 kB01-22-09 12:57
8.45 kB01-22-09 12:57
8.89 kB01-22-09 12:57
5.13 kB01-22-09 12:57
6.83 kB01-22-09 12:57
3.39 kB01-22-09 12:57
15.31 kB01-22-09 12:57
8.36 kB01-22-09 12:57
62.19 kB01-22-09 12:57
18.52 kB01-22-09 12:57
18.03 kB01-22-09 12:57
6.63 kB01-22-09 12:57
887.00 B01-22-09 12:57
12.15 kB01-22-09 12:57
3.32 kB01-22-09 12:57
11.45 kB01-22-09 12:57
6.17 kB01-22-09 12:57
24.71 kB01-22-09 12:57
12.78 kB01-22-09 12:57
udt.dll456.00 kB01-22-09 14:28
udt.exp15.05 kB01-22-09 14:28
10.50 kB01-22-09 12:57
udt.lib23.17 kB01-22-09 14:28
8.46 kB01-22-09 12:57
5.60 kB01-22-09 12:57
260.00 B01-22-09 12:57
appclient.vcproj3.93 kB01-22-09 12:57
appserver.vcproj3.93 kB01-22-09 12:57
recvfile.vcproj3.76 kB01-22-09 12:57
sendfile.vcproj3.79 kB01-22-09 12:57
udt.ncb123.00 kB01-22-09 14:28
udt.sln3.16 kB01-22-09 12:57
udt.suo12.50 kB01-22-09 14:28
udt.vcproj4.89 kB01-22-09 12:57
(提交有效评论获得积分)
评论内容不能少于15个字,不要超出160个字。
评价成功,多谢!
下载udt.sdk.4.4.win32.zi
CodeForge积分(原CF币)全新升级,功能更强大,使用更便捷,不仅可以用来下载海量源代码马上还可兑换精美小礼品了
您的积分不足,优惠套餐快速获取 30 积分
10积分 / ¥100
30积分 / ¥200原价 ¥300 元
100积分 / ¥500原价 ¥1000 元
订单支付完成后,积分将自动加入到您的账号。以下是优惠期的人民币价格,优惠期过后将恢复美元价格。
支付宝支付宝付款
微信钱包微信付款
更多付款方式:、
您本次下载所消耗的积分将转交上传作者。
同一源码,30天内重复下载,只扣除一次积分。
鲁ICP备号-3 runtime:Elapsed:222.223ms - init:0.1;find:0.6;t:0.4;tags:0.5;related:83.1;comment:0.2; 27.69
登录 CodeForge
还没有CodeForge账号?
Switch to the English version?
^_^"呃 ...
Sorry!这位大神很神秘,未开通博客呢,请浏览一下其他的吧 上传我的文档
 下载
 收藏
该文档贡献者很忙,什么也没留下。
 下载此文档
正在努力加载中...
Visual Studio 中如何编译和运行
下载积分:300
内容提示:Visual Studio 中如何编译和运行
文档格式:PDF|
浏览次数:6|
上传日期: 18:00:34|
文档星级:
该用户还上传了这些文档
Visual Studio 中如何编译和运行
官方公共微信

我要回帖

更多关于 内裤留下白带的图片 的文章

 

随机推荐