用户工具

站点工具


协议学习:network网络:socket类型

差别

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

两侧同时换到之前的修订记录前一修订版
后一修订版
前一修订版
协议学习:network网络:socket类型 [2022/02/09 08:42] – zhangguo协议学习:network网络:socket类型 [2026/10/13 22:51] (当前版本) – 外部编辑 127.0.0.1
行 1: 行 1:
-====== socket类型 ======+# socket类型 
 +[TCP和UDP的区别(Socket)](https://www.cnblogs.com/nieliangcai/p/10362751.html) 
 + 
 + 
 +``` 
 +AF_UNIX(本机通信) 
 +AF_INET(TCP/IP – IPv4) 
 +AF_INET6(TCP/IP – IPv6) 
 +其中 “type”参数指的是套接字类型,常用的类型有: 
 +SOCK_STREAM(TCP流) 
 +SOCK_DGRAM(UDP数据报) 
 +SOCK_RAW(原始套接字) 
 +``` 
  
 https://www.cnblogs.com/sanjianghuiliu/p/4653906.html https://www.cnblogs.com/sanjianghuiliu/p/4653906.html
行 19: 行 32:
  
  
-===== - python socket ===== +## - python socket 
-<code>+ 
 +```
 socket.socket(family=AF_INET, type=SOCK_STREAM, proto=0, fileno=None) socket.socket(family=AF_INET, type=SOCK_STREAM, proto=0, fileno=None)
-</code>+``` 
  
 Create a new socket using the given address family, socket type and protocol number. The address family should be AF_INET (the default), AF_INET6, AF_UNIX, AF_CAN, AF_PACKET, or AF_RDS. The socket type should be SOCK_STREAM (the default), SOCK_DGRAM, SOCK_RAW or perhaps one of the other SOCK_ constants. The protocol number is usually zero and may be omitted or in the case where the address family is AF_CAN the protocol should be one of CAN_RAW, CAN_BCM or CAN_ISOTP. Create a new socket using the given address family, socket type and protocol number. The address family should be AF_INET (the default), AF_INET6, AF_UNIX, AF_CAN, AF_PACKET, or AF_RDS. The socket type should be SOCK_STREAM (the default), SOCK_DGRAM, SOCK_RAW or perhaps one of the other SOCK_ constants. The protocol number is usually zero and may be omitted or in the case where the address family is AF_CAN the protocol should be one of CAN_RAW, CAN_BCM or CAN_ISOTP.
协议学习/network网络/socket类型.1644367351.txt.gz · 最后更改: (外部编辑)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki