Linux socket函数 编程手册 重点分析一
来源:互联网 发布:上海大数据培训哪里好 编辑:程序博客网 时间:2024/06/05 18:12
man socket:
头文件和函数原型:
#include <sys/types.h> /* See NOTES */
#include <sys/socket.h>
int socket(int domain, int type, int protocol);
domain参数指定通信域,具体取值定义类型都在<sys/socket.h>,现可用类型包括:
Name Purpose Man pagetype参数指定套接字的类型,进一步确定通信特征:
SOCK_STREAM Provides sequenced, reliable, two-way, connection-based byte streams. An out-of-band data trans‐
mission mechanism may be supported.
SOCK_DGRAM Supports datagrams (connectionless, unreliable messages of a fixed maximum length).
SOCK_SEQPACKET Provides a sequenced, reliable, two-way connection-based data transmission path for datagrams of
fixed maximum length; a consumer is required to read an entire packet with each input system call.
SOCK_RAW Provides raw network protocol access.
SOCK_RDM Provides a reliable datagram layer that does not guarantee ordering.
SOCK_PACKET Obsolete and should not be used in new programs; see packet(7).
参数protocol通常是零,标示按给定的域和套接字类型选择默认协议。当对同一域和套接字类型支持多个协议时,可以使用protocol参数选择一个特定协议:IPPROTO_TCP、IPPTOTO_UDP、IPPROTO_SCTP、IPPROTO_TIPC
接下去第二章实例分析。
- Linux socket函数 编程手册 重点分析一
- Linux socket函数 编程手册 重点分析二
- Linux socket函数 编程手册 重点分析三
- Linux socket编程学习笔记(一):socket()函数详解
- 【linux 编程】BSD Socket 简易入门手册
- 【linux 编程】BSD Socket 简易入门手册
- linux socket编程相关函数作用及参数详细分析
- windows socket编程函数(一)
- (Michael Kerrisk)Linux系统编程手册读书笔记(一)-----系统编程概念中的函数解析
- Linux下Socket编程(一)
- linux socket 编程(一)
- linux下SOCKET编程一
- Linux下Socket编程一 socket 基础
- Linux Socket编程一:socket的认识
- linux socket select 函数分析
- linux socket 编程 常用函数
- linux socket编程之socket()函数介绍
- linux socket编程之socket()函数介绍
- 菜鸟详解iar的icf文件(链接文件)
- Android ActionBar完全解析,使用官方推荐的最佳导航栏(上)
- Source Insight 添加新类型文件
- Hibernate进阶之如何使用Hql内连接,外连接以及自连接
- UVA10618 & POJ1726 & ZOJ2120 - Tango Tango Insurrection(比较烦的DP)
- Linux socket函数 编程手册 重点分析一
- linux上matlab的bug
- linux makefile 教程
- Android系统的定制---定制系统开机动画
- Cocos2d-JS 学习笔记[1]
- VC获取系统进程列表、查找进程、关闭进程
- SAE(Sina App Engine) 分词性能测试
- qt中mysql数据库经验总结
- 第109天