成人免费xxxxx在线视频软件_久久精品久久久_亚洲国产精品久久久_天天色天天色_亚洲人成一区_欧美一级欧美三级在线观看

udp 中文man頁面

系統
這是一個 RFC768 中的用戶數據報協議的實現. 它實現無連接的, 不可靠的數據報信息包服務. 信息包可能在它們傳輸到達之前重新排序或者重復. UDP 通過生成和檢查校驗和來俘獲傳輸錯誤.

NAME (名字)

udp - IPv4 上面的 UDP 協議.  

SYNOPSIS (總覽)

#include <sys/socket.h>
#include <netinet/in.h>
udp_socket = socket(PF_INET, SOCK_DGRAM, 0);

DESCRIPTION(描述)

這是一個 RFC768 中的用戶數據報協議的實現. 它實現無連接的, 不可靠的數據報信息包服務. 信息包可能在它們傳輸到達之前重新排序或者重復. UDP 通過生成和檢查校驗和來俘獲傳輸錯誤.

當創建一個 UDP 套接字時, 它的本地和遠程地址是不確定的. 可以使用帶一個有效目的地址作為參數的 sendto(2) 或者 sendmsg(2) 立即發送數據報.如果套接字上調用了 connect(2) 時, 則設置默認的目的地址, 數據報可以使用 send(2) 或者 write(2) 發送而不需要指定目的地址. 也可以通過傳遞一個地址給 sendto(2) 或者 sendmsg(2) 來發送到其它目的地址. 為了接收信息包,套接字必須首先用 bind(2) 綁定一個本地地址, 如果沒有這么做, 套接字層在第一個用戶接收請求時將自動分配一個本地端口.

所有接收操作只返回一個信息包. 當信息包小于所傳遞的緩沖區時, 則只返回那些數據, 當信息包大于所傳遞的緩沖區時,則截斷信息包并設置 MSG_TRUNC 標志.

IP 選項可以使用描述于 ip(7) 中的套接字選項發送或接收. 只有打開了合適的 sysctl 時, 內核才處理它們(不過即使關閉了它們, 仍然會傳遞給用戶). 參見 ip(7).

如果設置了 MSG_DONTROUTE 標志,則發送時目的地址必須指向一個本地接口地址, 而且信息包只發到該接口.

當 UDP 的總長超過接口 MTU(Maximum Transmission Unit 最大傳輸單元)時, UDP 會對信息包進行分段. 一個更為網絡友好的可選方法是使用 path MTU discovery(路徑MTU發現), 它描述于 ip(7) 中的 IP_PMTU_DISCOVER 部分.

ADDRESS FORMAT (地址格式)

UDP 使用 IPv4 的 sockaddr_in 地址格式,其描述于 ip(7) 中.

ERROR HANDLING (錯誤處理)

所有重大錯誤都會以錯誤返回值的方式傳遞給用戶, 即使套接字沒有連接亦如此.這種處理方式有別于許多其它的 BSD 套接字實現方法, 除非套接字連接上, 否則那些方法不會傳遞任何錯誤, Linux 的處理方式遵循 RFC1122 的要求.

為了與以前的代碼兼容,可以設置 SO_BSDCOMPAT SOL_SOCKET 選項令只在套接字已連接的情況下接收遠程錯誤( EPROTOEMSGSIZE) 除外. 最好是修復代碼并適當地處理錯誤, 而不要打開該選項. 本地產生的錯誤總是傳遞.

當打開了 IP_RECVERR 選項時, 所有錯誤可以存儲在套接字錯誤隊列中, 并可以通過帶 MSG_ERRQUEUE 標識設置的 recvmsg(2) 來接收.

ERRORS (錯誤)

所有列在 socket(7) 或 ip(7) 中的錯誤都可以在一個 UDP 套接字上收發時收到.

ECONNREFUSED 沒有與目的地址相關聯的接收者. 這可能由于在前面一個通過該套接字發送的信息包而引發.

VERSIONS(版本)

IP_RECVERR 是 Linux 2.2 中的新功能.

CREDITS(尾注)

本手冊頁的作者為 Andi Kleen.

SEE ALSO(另見)

ip(7), socket(7), raw(7).

RFC768: 用戶數據報協議.
RFC1122: 主機需求
RFC1191: 描述 path MTU discovery (路徑MTU查找).

#p#

NAME

udp - User Datagram Protocol for IPv4  

SYNOPSIS

#include <sys/socket.h>
#include <netinet/in.h>
udp_socket = socket(PF_INET, SOCK_DGRAM, 0);  

DESCRIPTION

This is an implemention of the User Datagram Protocol described in RFC768. It implements a connectionless, unreliable datagram packet service. Packets may be reordered or duplicated before they arrive. UDP generates and checks checksums to catch transmission errors.

When a UDP socket is created, its local and remote addresses are unspecified. Datagrams can be sent immediately using sendto(2) or sendmsg(2) with a valid destination address as an argument. When connect(2) is called on the socket the default destination address is set and datagrams can now be sent using send(2) or write(2) without specifying an destination address. It is still possible to send to other destinations by passing an address to sendto(2) or sendmsg(2). In order to receive packets the socket can be bound to an local address first by using bind(2). Otherwise the socket layer will automatically assign a free local port out of the range defined by net.ipv4.ip_local_port_range and bind the socket to INADDR_ANY.

All receive operations return only one packet. When the packet is smaller than the passed buffer only that much data is returned, when it is bigger the packet is truncated and the MSG_TRUNC flag is set. MSG_WAITALL is not supported.

IP options may be sent or received using the socket options described in ip(7). They are only processed by the kernel when the appropriate sysctl is enabled (but still passed to the user even when it is turned off). See ip(7).

When the MSG_DONTROUTE flag is set on sending the destination address must refer to an local interface address and the packet is only sent to that interface.

UDP fragments a packet when its total length exceeds the interface MTU (Maximum Transmission Unit). A more network friendly alternative is to use path MTU discovery as described in the IP_MTU_DISCOVER section of ip(7).

ADDRESS FORMAT

UDP uses the IPv4 sockaddr_in address format described in ip(7).

ERROR HANDLING

All fatal errors will be passed to the user as an error return even when the socket is not connected. This includes asynchronous errors received from the network. You may get an error for an earlier packet that was sent on the same socket. This behaviour differs from many other BSD socket implementations which don't pass any errors unless the socket is connected. Linux's behaviour is mandated by RFC1122.

For compatibility with legacy code it is possible to set the SO_BSDCOMPAT SOL_SOCKET option to receive remote errors only when the socket has been connected (except for EPROTO and EMSGSIZE). It is better to fix the code to handle errors properly than to enable this option. Locally generated errors are always passed.

When the IP_RECVERR option is enabled all errors are stored in the socket error queue and can be received by recvmsg(2) with the MSG_ERRQUEUE flag set.  

IOCTLS

These ioctls can be accessed using ioctl(2). The correct syntax is:

int value;
error = ioctl(tcp_socket, ioctl_type, &value);
SIOCINQ
Gets a pointer to an integer as argument. Returns the size of the next pending datagram in the integer in bytes, or 0 when no datagram is pending.
SIOCOUTQ
Returns the number of data bytes in the local send queue. Only supported with Linux 2.4 and above.

In addition all ioctls documented in ip(7) and socket(7) are supported.  

ERRORS

All errors documented for socket(7) or ip(7) may be returned by a send or receive on a UDP socket.

ECONNREFUSED No receiver was associated with the destination address. This might be caused by a previous packet sent over the socket.

VERSIONS

IP_RECVERR is a new feature in Linux 2.2.

CREDITS

This man page was written by Andi Kleen.

SEE ALSO

ip(7), socket(7), raw(7)

RFC768 for the User Datagram Protocol.
RFC1122 for the host requirements.
RFC1191 for a description of path MTU discovery.

責任編輯:韓亞珊 來源: CMPP.net
相關推薦

2011-08-15 10:21:09

man中文man

2011-08-24 16:48:36

man中文man

2011-08-11 16:11:49

at中文man

2011-08-25 10:21:56

man.conf中文man

2011-08-11 15:03:21

ACCESS中文man

2011-08-11 15:28:43

ali中文man

2011-08-11 16:31:49

biff中文man

2011-08-11 17:16:43

cce中文man

2011-08-11 18:05:04

chvt中文man

2011-08-11 18:13:07

clear中文man

2011-08-12 09:13:02

df中文man

2011-08-12 09:38:06

dircolors中文man

2011-08-12 09:44:37

dirname中文man

2011-08-12 10:20:02

echo中文man

2011-08-12 10:25:55

eject中文man

2011-08-12 11:07:19

git中文man

2011-08-12 13:18:19

head中文man

2011-08-12 13:49:23

hostid中文man

2011-08-12 13:54:46

hostname中文man

2011-08-12 14:53:56

kill中文man
點贊
收藏

51CTO技術棧公眾號

主站蜘蛛池模板: 成人在线观看免费 | 操人网站 | 欧美日韩综合精品 | 亚洲高清视频在线观看 | 91国内精品| 一级片免费观看 | av在线免费播放 | 欧美日韩视频网站 | 亚洲视频三区 | 欧美 日韩 亚洲91麻豆精品 | 在线观看黄免费 | 国产亚洲日本精品 | 精品国产一级片 | 欧美最猛黑人xxxⅹ 粉嫩一区二区三区四区公司1 | 精品在线一区二区三区 | 久久久99国产精品免费 | 成人免费视频久久 | 久久精品小短片 | 久久亚洲春色中文字幕久久久 | 欧美在线资源 | 久久综合狠狠综合久久综合88 | 日韩毛片免费看 | 亚洲网站在线观看 | 欧美久 | 久久久久亚洲精品 | 日韩欧美中文字幕在线观看 | 日韩视频中文字幕 | 99精品国产一区二区青青牛奶 | 亚洲天堂中文字幕 | 天天拍天天操 | 九九导航 | 国产精选一区 | 理论片免费在线观看 | 亚洲国产成人精品女人久久久 | 亚洲网在线 | 中文字幕av网站 | 日韩福利在线观看 | av色在线| 97视频人人澡人人爽 | 影音先锋中文在线 | 日韩av高清|