udt4编程简介(原文)
来源:互联网 发布:数据权限流程图 编辑:程序博客网 时间:2024/04/30 00:43
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:
Its counterpart in UDT is like this:
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:
Header
#include <udt.h>
Library (depending on platforms)
libudt.so
libudt.a
udt.dll
udt.lib
udt.dylib
Namespace
UDT
http://udt.sourceforge.net/udt4/doc/t-intro.htm
- udt4编程简介(原文)
- UDT4分析(一)之主要api调用关系
- udt4 helloworld
- 文艺编程 Literate Programming (原文中英文对照)
- 文艺编程 Literate Programming (原文中英文对照)
- 文艺编程 Literate Programming (原文中英文对照)
- udt4 VS udt gateway
- UDT4之握手分析
- 工作流现状 (原文)
- 一碗阳春面(原文)
- 一碗阳春面(原文)
- nginx_upstream_check_module(原文)
- 原文
- 关于DX多窗口编程的一篇翻译(感谢Happy_888网友给出的原文 ^_^)
- 数据绑定英文(原文)
- 工作流现状 (原文)(转)
- Tcl编程简介(一)
- Tcl编程简介(二)
- Jquery插件开发 详细
- 回调函数和观察者模式
- php里 file_get_contents("php://input")
- Unity3D架构设计NavMesh寻路
- [Elasticsearch] 部分匹配 (三) - 查询期间的即时搜索
- udt4编程简介(原文)
- CPU中的缓存和操作系统中的缓存分别是什么?
- PL/SQL基础(四)
- 微信企业号开发:获取数据权限错误如何处理
- 感悟
- linux 嵌入式 自启动 系统自动登录-自动启动程序或脚本
- 黑马程序员-IOS基础之C语言流程控制
- 使用wireshark的tshark工具把pcap导出csv格式
- 创业12年后,我为什么创立ZMO企业自媒体联盟