Socket API 分类
来源:互联网 发布:http文件上传java 编辑:程序博客网 时间:2024/05/16 18:46
本文摘自:C++ Network Programming, Volume 1: Mastering Complexity with ACE and Patterns
Socket API共有20多个函数,被分为5大类。
1、Local context management. The Socket API provides functions to manage local context information, which is normally stored within the OS kernel or in system libraries:
Deallocates a socket handle, making it available for reuse.
2、Connection establishment and connection termination. The Socket API provides functions to establish and terminate connections:
3、Data transfer mechanisms. The Socket API provides functions to send and receive data via socket handles:
send()recv()Transmit and receive buffers of data via a particular I/O handle.
sendto()recvfrom()Exchanges connectionless datagrams, where each sendto() call provides the networking address of the recipient.
On UNIX, these functions can also be used for other types of 1/O handles, such as files and terminal devices. UNIX platforms also provide the following data transfer mechanisms:
read()write()Receive and transmit buffers of data via a particular handle.
readv()writev()Supports scatter-read and gather-write semantics, respectively, to optimize mode switching and simplify memory management.
sendmsg()recvmsg()General-purpose functions that subsume the behavior of the other data transfer functions.
4、Options management. The Socket API defines functions that allow programmers to alter default socket behavior to enable multicasting, broadcasting, and modifying/querying the size of transport buffers:
5、Network addressing. In addition to the functions described above, networked applications often use functions to resolve humanly readable names, such as tango.ece.uci.edu, to low-level network addresses, such as 128.195.174.35:
gethostbyname()gethostbyaddr()Handle network address mapping between hostnames and IPv4 addresses.
getipnodebyname()getipnodebyaddr()Handle network address mapping between hostnames and IPv4/IPv6 addresses.get servbyname()Identifies services by their humanly readable names.
- Socket API 分类
- API分类
- socket api
- socket API
- socket API
- Socket API
- Socket API
- Socket APi
- socket api
- API函数分类
- windows API的分类
- java API 分类
- Win32 API分类
- windows API的分类
- OpenGL API分类
- Web Api 分类
- Windows API分类
- windows API 分类
- Windows 内存管理
- Overlay中文显示
- 扬声器的工作原理
- JS读取Excel资料AJAX导入
- 网络挂载rootfs
- Socket API 分类
- 任务管理器分类
- 王国维 《人间词话》人生三大境界
- JavaScript检查ActiveX控件是否已经安装过
- 重启mysql
- ID/Locator分离研究笔记
- 修改注册表隐藏硬盘分区的解除办法
- (4) 摄像机、光照和阴影
- (5) 地形、天空和雾