Files
boc/rust-service/target/debug/deps/libsocket2-fe803a4340fa19d8.rmeta
T

1042 lines
373 KiB
Plaintext
Raw Normal View History

rust
¯Ð#rustc 1.96.0 (ac68faa20 2026-05-25)ÁÀ뉊]!ÜÛê(¹Þ—šên-5be7b69c3ff7b5b8ÁíàÄTËŸ ÜJîÄ)'ß\¥!-3d1337db07d0b3aeÁ¤²XctÔ'ÐÓ©z¨ɽÓ-a4945860e1c53b00Á¤°ð ¾ä-±($²ï=©Ã-7e98a21bfd32b0edÁòÖÀH•‘PIÓHã#£-055f30b747f859b6Árustc_std_workspace_coreÁ­Cçß^ò½èÝ$­Çÿ+Cé-c4878ee60b2242c9ÁŸÃï+Ñ]ŠqB<ÏïW#-8dd1dd90e70d0b6aÁ miniz_oxideÁ€š»J(P>àö÷g\K-1eb618da2918ab7fÁadler2ÁÆ;+Þ®5¥Ìýݰ¦ÛLˆ-f7919172d268e069Á hashbrownÁPäV9ÒÆèÜ"ÊÖVŽ\-0fc2184a5da6723aÁrustc_std_workspace_allocÁs&ØòØy¯s•bæ!‰ýŠ-97e4bf30be240674Á
std_detectÁhŠBîÙºÌI®ËÅš-9dbbf8346ba7ac8bÁrustc_demangleÁûë9´Ç×@Œ’ùXFº-f33013f239bf9f14Ácfg_ifÁÜLhž§Œaã¯>­-0a71c8f33a838301Á addr2lineÁ׎Þ!]8V$É@@-e618e6be60e87ba2ÁgimliÁ¸
°µ~Î1‹Ñt ðÁ€w-1f7768a68858f670ÁobjectÁ
áPÃ?­À¶¼QHJ¥-914cd6a4dbe590d1ÁmemchrÁ›º«8Ór­2Ù $¨ûib-cf21ca6f2bb15dcdÁë
‹ás«LÖ€îâƒ×ɯŒ-ee6f3747e38367f0Á?A©ú¡E2¯ëäu-8e0657b9e365f274ÁSOCKADDR_IN6_0ÁtøâtestsÁ,Ð{$Å{U
FromRawSocketÁl³âU
IntoRawSocketÁlÂâ "Uset_common_accept_flagsÁ¼Úó úandroidÁ¬åñú dragonflyÁ¼€òúfreebsdÁ¬òúfuchsiaÁ¬¸òúillumosÁ¬ÓòúlinuxÁœîòúnetbsdÁ¤‡óúopenbsdÁ¬¡óúcygwinÁ¤¼óüßñôüÛñù± AsRawSocketÁ\øâ±AsSocketÁD…â±§lâ.IPPROTO_DIVERTÁtŸú¶ ¬Ùú
¬ðüØ.É SO_LINGERÁLŠ2úiosÁŒå0úvisionosÁ´ü0úmacosÁœ˜1útvosÁ”±1úwatchosÁ¬É1üß0ÉIPV6_ADD_MEMBERSHIPÁœ¶A
ú  ¼˜>ú¶ ¬µ>úhaikuÁœÐ>úÞ ¬é>úå Œ„?úô ´›?úˆ œ·?ú
¤Ð?ú
¬ê?úsolarisÁ¬…@ú ” @ú© ¬¸@úwasiÁ”×@îp1ÁŒï@œî@üÖ@,ü’>óÉIPV6_DROP_MEMBERSHIPÁ¤ßA
ú  íúëúú äúÞ âúå àúô Þúˆ Üú
Úú
ØúÓ
Ïú Íú© ËúÅîÁ¿½º¼ÉKEEPALIVE_TIMEÁt•Júå Œ­Húô ´ÄHúˆ œàHúntoÁŒýHînto70Á¤”Iînto71Á¤ªIü“I,üüHEú ”ÇIú© ¬ßIü§HÐÉ MAX_BUF_LENÁ\÷Vúå ŒØUúô ´ïUúˆ œ‹Vú ”¤Vú© ¬¼Vú«
¤×VüÒUœÉIovLenÁ4®`úò œæZîmuslÁœ”[îohosÁœµ[îuclibcÁ¬Ú[û32ÁÜñ[üÙ[4ü†[‘üÜZÁúaixÁŒ£\ú  ¼º\ú
emscriptenÁÄ×\ú¶ ¬õ\úÊ ¬]úú œ«]úhurdÁ”Ä]úÞ ¬Ü]úå Œ÷]úô ´Ž^úˆ œª^ú
¤Ã^ú¥ŒÝ^ú
¬ô^úÓ
¬_ú ”ª_ú© ¬Â_úespidfÁ¤Ý_úvitaÁ”÷_ú«
¤`üÓZÓÉå4ß`únuttxÁœÄ`É
\úË”ëŠÉset_nonblockingÁ|úË”îŽÀ 

impl_debugÁ÷sockaddrÁ 
  
 socklen_tÁ sa_family_tÁSockAddrStorageÁ(storageÁ*zeroedÁ*š*view_asÁ-¥/×1æ 1try_initÁ33¥3 STORAGE_SIZEÁ3 1ú8¡1
set_lengthÁ1familyÁ1domainÁ11as_ptrÁ1
as_storageÁ1is_ipv4Á1is_ipv6Á1is_unixÁ1 as_socketÁ1as_socket_ipv4Á1as_socket_ipv6Á1as_bytesÁG÷I÷K÷M×O R§SsocketÁUUUUUUUUUU U
U U U
UUUUUUUUUUUUUUUUUUU U!U"USocketÁyinnerÁU{from_rawÁ{as_rawÁ{into_rawÁ{æ {new_rawÁ {pairÁ{pair_rawÁƒ ƒ {bindÁ{connectÁ{connect_timeoutÁ{listenÁ{acceptÁ{
accept_rawÁ {
local_addrÁ{ peer_addrÁ{!{ try_cloneÁ{
{¡{shutdownÁ{recvÁ{recv_out_of_bandÁ{recv_with_flagsÁ{
recv_vectoredÁ{recv_vectored_with_flagsÁ{peekÁ{ recv_fromÁ{recv_from_with_flagsÁ{recv_from_vectoredÁ{recv_from_vectored_with_flagsÁ{ peek_fromÁ{ peek_senderÁ{recvmsgÁ{sendÁ{send_with_flagsÁ{
send_vectoredÁ{send_vectored_with_flagsÁ{send_out_of_bandÁ{send_toÁ{send_to_with_flagsÁ{send_to_vectoredÁ{send_to_vectored_with_flagsÁ{sendmsgÁUset_common_typeÁUset_common_flagsÁU­ broadcastÁ® ­
set_broadcastÁ­
take_errorÁ­ keepaliveÁ² ­
set_keepaliveÁ­lingerÁ­
set_lingerÁ­out_of_band_inlineÁ· ­set_out_of_band_inlineÁ­passcredÁº ­ set_passcredÁ­priorityÁ½ ­ set_priorityÁ­recv_buffer_sizeÁÀ ­set_recv_buffer_sizeÁ­ read_timeoutÁ­set_read_timeoutÁ­
reuse_addressÁÅ ­set_reuse_addressÁ­send_buffer_sizeÁÈ ­set_send_buffer_sizeÁ­
write_timeoutÁ­set_write_timeoutÁU from_lingerÁU into_lingerÁUÏheader_included_v4ÁÐ Ïset_header_included_v4ÁÏip_transparent_v4ÁÓ Ïset_ip_transparent_v4ÁÏjoin_multicast_v4ÁÏleave_multicast_v4ÁÏjoin_multicast_v4_nÁÏleave_multicast_v4_nÁÏ join_ssm_v4ÁÏ leave_ssm_v4ÁÏmulticast_all_v4ÁÜ Ïset_multicast_all_v4ÁÏmulticast_if_v4ÁÏset_multicast_if_v4ÁÏmulticast_loop_v4Áá Ïset_multicast_loop_v4ÁÏmulticast_ttl_v4Áä Ïset_multicast_ttl_v4ÁÏttl_v4Áç Ï
set_ttl_v4ÁÏ
set_tos_v4ÁÏtos_v4Áë Ïset_recv_tos_v4ÁÏ recv_tos_v4Áî Ïoriginal_dst_v4ÁUñheader_included_v6Áò ñset_header_included_v6Áñip_transparent_v6Áõ ñset_ip_transparent_v6Áñjoin_multicast_v6Áñleave_multicast_v6Áñmulticast_hops_v6Áú ñset_multicast_hops_v6Áñmulticast_all_v6Áý ñset_multicast_all_v6Áñmulticast_if_v6Á ñset_multicast_if_v6Áñmulticast_loop_v6Áƒ ñset_multicast_loop_v6Áñunicast_hops_v6Á ñset_unicast_hops_v6Áñonly_v6Á ñ set_only_v6Áñrecv_tclass_v6ÁŒ ñset_recv_tclass_v6Áñrecv_hoplimit_v6Á ñset_recv_hoplimit_v6Áñoriginal_dst_v6ÁUtcp_keepalive_timeÁtcp_keepalive_intervalÁ tcp_keepalive_retriesÁ set_tcp_keepaliveÁ tcp_nodelayÁš set_tcp_nodelayÁUreadÁ
read_vectoredÁŸ U¡'aÁ¡¢2¡®2¤ U¦writeÁ¦write_vectoredÁ¦flushÁUªÌ2ªï2ªü2ª’3U ¯×sockrefÁ±±±±±±±±±±SockRefÁ»'sÁ»Ú» _lifetimeÁ±¿™4¿å¿´±Ã™4äÃ÷±Ç×sysÁÉÉÉÉÉÉÉÉÉÉ É
É É É
ÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉ É!É"É#É$É%É&É'É(É)É*É+É,É-É.É/É0É1É2É3É4É5É6É7É8É9É:É;É<É=É>É?É@ÉAÉBÉCÉDÉEÉFÉGÉHÉIÉJÉKÉLÉMÉNÉOÉPÉQÉRÉSÉTÉUÉVÉWÉXÉYÉZÉ[É\É]É^É_É`ÉaÉbÉcÉdÉeÉfÉgÉhÉiÉjÉkÉlÉmÉnÉoÉpÉqÉrÉsÉtÉuÉvÉwÉxÉyÉzÉ{É|É}É~ÉÉÉÉXÉÉsyscallÁÉÿÉTCP_CA_NAME_MAXÁÉåÉÒPACKETÁÒVSOCKÁÉÕ
ÕcloexecÁÕ_cloexecÁÉÙis_end_of_recordÁÙis_out_of_bandÁÙ
is_confirmÁÙ is_dontrouteÁÉÞ×ÉMaybeUninitSliceÁàÌ2àÁà«4ÉäÌ2ÉæÌ2ÉèÌ2èæ èas_sliceÁè as_mut_sliceÁÉoffset_of_pathÁÉ
unix_sockaddrÁɃÉset_msghdr_nameÁÉset_msghdr_iovÁÉset_msghdr_controlÁÉset_msghdr_flagsÁÉ msghdr_flagsÁÉmsghdr_control_lenÁÉövsockÁöas_vsock_addressÁÉù
is_unnamedÁú ùas_sockaddr_unÁü ùpath_lenÁù
path_bytesÁùas_unixÁù as_pathnameÁ  ùas_abstract_namespaceÁ  ÉóÉ RawSocketÁÉsocket_from_rawÁÉ
socket_as_rawÁÉsocket_into_rawÁÉÚÉ
socketpairÁ  Éù É É poll_connectÁɨ ɵ É getsocknameÁ  É getpeernameÁœ œ ÉÿÉ
ɡɢ ɬ¤ É¢¦ § Éš © ÉäÉͬ ɬ ® ɺ ° ÉÛ É¥!³ ÉÌ!É…" É timeout_optÁÉ from_timevalÁÉset_timeout_optÁÉ into_timevalÁÉ÷0¼ ÉÖ1É into_secsÁÉ fcntl_getÁÉ fcntl_addÁÁ É fcntl_removeÁà É
getsockoptÁťŠÉ
setsockoptÁÈ¥È É
to_in_addrÁÉ from_in_addrÁÉ to_in6_addrÁÉ
from_in6_addrÁÉto_mreqnÁÉä+Ð Ð ÉÜ0Ó Ó É Öaccept4ÁÖ_accept4ÁØ Ö set_cloexecÁÖ _set_cloexecÁÖtcp_mssÁÜ Ö set_tcp_mssÁÖ is_listenerÁß ÖèÖprotocolÁâ ÖmarkÁä Öset_markÁÖtcp_corkÁç Ö set_tcp_corkÁÖ tcp_quickackÁê Öset_tcp_quickackÁÖtcp_thin_linear_timeoutsÁí Öset_tcp_thin_linear_timeoutsÁÖtcp_notsent_lowatÁð Öset_tcp_notsent_lowatÁÖdeviceÁó Ö bind_deviceÁõ Öbind_device_by_index_v4ÁÖbind_device_by_index_v6ÁÖdevice_index_v4ÁÖdevice_index_v6ÁÖ cpu_affinityÁû Öset_cpu_affinityÁÖ
reuse_portÁþ Öset_reuse_portÁÖ freebind_v4Á Öset_freebind_v4ÁÖ freebind_v6Á Öset_freebind_v6ÁÖsendfileÁÖ _sendfileÁ Öset_tcp_user_timeoutÁ Ötcp_user_timeoutÁ Ö
attach_filterÁÖ
detach_filterÁÖcookieÁÖ tclass_v6Á Ö
set_tclass_v6ÁÖtcp_congestionÁ   Öset_tcp_congestionÁ Öset_dccp_serviceÁÖ dccp_serviceÁÖ
set_dccp_ccidÁÖ dccp_tx_ccidÁÖ dccp_xx_ccidÁÖset_dccp_server_timewaitÁÖdccp_server_timewaitÁÖset_dccp_send_cscovÁÖdccp_send_cscovÁÖset_dccp_recv_cscovÁÖdccp_recv_cscovÁÖset_dccp_qpolicy_txqlenÁÖdccp_qpolicy_txqlenÁÖdccp_available_ccidsÁ¨Ÿ¨ Ö dccp_cur_mpsÁÖ busy_pollÁÖ
set_busy_pollÁÉ
SockFilterÁ®filterÁÉ
°æ É ²×É ´Ÿ´å´´É
¸as_fdÁɺ as_raw_fdÁɼ÷ɾ into_raw_fdÁÉÀ÷É from_raw_fdÁ  
ÏIPV4ÁÏIPV6ÁÏUNIXÁÏ for_addressÁÔ÷Ö÷ØSTREAMÁØDGRAMÁØDCCPÁØ SEQPACKETÁØRAWÁÞ÷à÷âICMPV4ÁâICMPV6ÁâTCPÁâUDPÁâMPTCPÁâçTâSCTPÁâUDPLITEÁë÷í÷ ï is_truncatedÁŽ<ñ
ñÌ2ñˆ
õÌ2õ× øÌ2øæ  ûÌ2ûåû´
ÿÌ2ÿæ  with_timeÁ
with_intervalÁ with_retriesÁMsgHdrÁ'addrÁ'bufsÁ'controlÁ
_lifetimesÁ„X‘XžXæ  with_addrÁ with_buffersÁ with_controlÁ
with_flagsÁ'nameÁXžX× MsgHdrMutÁœ„Xœ‘XœžXœœ¶X¢„X¢‘X¢žX¢æ ¢ìX¢ýX¢‘Y¢flagsÁ¢ control_lenÁ¬»Y¬‘X¬žX¬× man_linksÁSockAddrÁ³·³
ƒUInterfaceIndexOrAddressÁ¸IndexÁ¹
¹ˆ¸AddressÁ¼
¼ˆU
¿×U U U
ÃUÅ÷UÇ÷UÉ÷UË÷UÍ÷UÏ÷ÉÑ×ÉÓ×ÉÕ×É
CcidEndpointsÁ×Ÿ× endpointsÁÙ ×lengthÁÉÜŸÜ Ü×Éà÷Éâ÷Éä÷Éæ÷Éè÷Éê÷DomainÁì
ìˆñƒóÖöóø
øˆýƒÿÖ ProtocolÁ
ˆ!"#ƒ$Ö%&Ž RecvFlagsÁ
ˆ'()ƒ*Ö+,š TcpKeepaliveÁœtimeÁœintervalÁœretriesÁ- ×.¢ƒ,
-
0
0
0
:
;
<
=
>
@
A
B
C
D
E
F
N
N
N
P
P
S
S
}




ˆ
ˆ

Š


Ž














˜
˜
˜


š
š


œ
œ
œ



ž
ž
Ÿ
 
 
 
 
 
¡
¡
¢
¢
£
£
£
¤
¤
¤
¥
¥
¦
¦
¦
§
§
§
¨
¨
¨
¨
©
©
©
©
ª
ª
ª
ª
ª
®
°
±
²
´
µ

·
¹
º
¼
½
¿
À
Â
Ã
Ä
Å
Ç
È
Ê
Ë
Ì
Ð
Ò
Ó
Õ
Ö
Ö
Ö
×
×
×
Ø
Ø
Ø
Ù
Ù
Ù
Ú
Ú
Ú
Ú
Û
Û
Û
Û
Ü
Þ
ß
à
à
á
ã
ä
æ
ç
é
ê
ë
í
î
ð
ò
ô
õ
÷
ø
ø
ù
ù
ú
ü
ý
ÿ


ƒ


ˆ


Œ
Ž








š
œ
ž
ž
Ÿ
Ÿ
Ÿ
£
£
¤
¤
¤
§
§
¨
¨
¨
©
¬
¬
­
­
­
®
°
°
°
Â
Ç
È
È
È
ß
ß
ß
ë
ì
í
î
ð
ð
ñ
ò
ó
ô
õ
ø
ú
ü
þ
þ
ÿ
ÿ



Š



¤
¦
«
«
¬
¬
®
®
®
®
°
²
²
³
³
µ
µ
µ




¾
Ë
Í
Ï
Ï
×
Ø
Ú
Û
Ü
Þ
ß
á
â
ä
æ
ç
é
ê
ì
í
ï
ð
ò
ó
õ
õ
÷
ø
ù
ú
û
ý
þ


ƒ

















œ

ž
Ÿ
 
¡
¢
£
¤
¥
¦
§
¨
«
¬
­
³
³
³
·
¹
»
÷
÷
÷
þ


š
š
š



¨
ª
«
°
°
°
±
±
±
·
À
À
À
Ä
Ò
Ò
Ò
Ô
Ô
Ô
Ö
Ö
Ö
ß
ß
ß
ò
ô
÷
÷
þ

ƒ
ƒ
Š
Œ



˜


¡
¡
¡
£
¿c((¡)·+#ií?‡Ò3س³¯[´·µ?Æ'OJ"Pžés“¼”¼•¼V4Á–¼ˆ—¼˜¼V6Á™¼ˆ cÌ£•ésª¼ª¼ SocketAddrV4Á«¼ipÁÑS¬¼portÁÑSµÃѨbF(Æés½¼½¼ SocketAddrV6Á¾¼ÎsÑS¿¼ÝsÑSÀ¼flowinfoÁÑSÁ¼scope_idÁÑS¸dÛÔ#¹G[¿csµßsssšes¿c¸¹ºù[»ˆ¼½“\¾ˆ$šÞÞX¥ÜŠ ­vÛ­vØ­và yyózUýÎ}AƒÏà  Ì2šwŸ!šwŸ!Ëw¿cšwéšw‡#‡#ˆ# TcpStreamÁ‰#ˆô" ¤‰?ßøéšwŠ#Š## TcpListenerÁŒ#ˆô" N À];óÉéšwð#ð#ñ# UdpSocketÁò#ˆà# ¬ãøàFð™éýwšwéÂxšwé‰yšwé!»»Š4½Ú±¾«4±ÇSZä ·‹ˆ™4éòy ™4¤¿c»»Š4½Ú±¾«4±ÇSZä ·‹ˆ8¿cììíæ^îˆ éH<[îÔ„ƒ¿cøøùóúˆ Ð ×õ*ž¿cô_ˆ “3Nîйþ¿cÀ`ˆ ¥õÚlÆ ZÌìààŽ<âÁÉã«4É(ýÍå!Ì2 ÷|¿c®®€R¯’RÉ‹íhÒx#»¿c××¾]ÙÛ]ÉÛñ]ÉrDÒ!ŸTaŸé!ý},šw«+šwéö+ö+OwnedFdÁ÷+fdÁä+Þí¼>XG¸,šw¯+šwéšwâ~­+šwéšw­(­(®(
UnixStreamÁ¯(ˆê% ×¶'™g$²éšwã'ã'ä' UnixListenerÁå'ˆË' Nó:xÔ§eöéšw''“' UnixDatagramÁ”'ˆñ& ÒÛ0É@ßhéÇšwéšwéÕ€šwŠ –{Û–{Ø–{–{Ðì–{µß–{–{é–{é–{Š Î{ÛÎ{ØÎ{Î{ÐìÎ{µßÎ{Î{éÎ{éÎ{Š †|Û†|؆|†|Ðì†|µß†|†|é†|é†|Š ¾|Û¾|ؾ|¾|Ðì¾|µß¾|¾|¿cññòŽ<ôˆ ëp%×—µíÌ2é!•„ö!•„¿cœœa¡až­aŸ½aŽŽj„à1ÀØé„¿cöWŒ¶XKDÑ[6õ\»Y‘XžXÌìöWŒ¶XKDÑ[6õ\888¿cœœãY ¡¶XœB6I‰æG»Y‘XžXÌ윜ãY ¡¶XœB6I‰æG888/(M³¿¸¯»ÑìÓøÕÞ²®Ü×õñ œ¬œ³Ã¸ñìýø¢œG³I³K³Å‡#ÍŠ#Ïð#û¼ö+À­ã'êìÖÞøàëíO³öìøŽšQ³óìÿøR³Á¸ïìûøÂ¸ðìüøˆ
¦
¿»´×ûñä౜æà¸ìøÿñ¿cÀØeé1µß˜"še"Š Û#à #Ÿ! é! Ìì ,«+¯+­+Ðìö!|%ËËsockaddr_storageÁÌ ss_familyÁÍ __ss_pad2ÁŒÏ
__ss_alignÁŒ‡^³bAÉ C„±%±%üï$] ³ Ë%Ò%2ü—$»sDÜ$Ür<¯$É$³ü·$(Sìð3
Üð3
À³+üð3* ™4üÐ3K6Lä3n+´†>³¢>;üÒ=P\ð= s,æ= /ü‡?´‡?³& ¥?ü€?' ì ¦?­?<üÑ>\{4ï>•‘,å>;D•@£@=üæ?=L@•‘,÷? -ü–A(lA³ü–AB Ür ×A ÝAÞA>ü×@‡‹”´õ@•‘,ë@ ³ ³ DdòB³üËB> ( ˆCC?üBÜr|±Bs$¨B³h4´œD³´¶D<¶DØüœD0 ËDÒD@üîCd$D•‘,ƒDy:Ø´èE³¼‚FD‚FàüèE1 ˜FŸFAüºEe$ÙE•‘,ÏEy:à¯æ´æ l´æ

D·æ
Ø4T·æ Àæ§ç ªç«ç«üúâ±ü«æÎ{$ ãÎ{“ãÎ{®Î{¬´´ÌUœƒÖtƒÖ ! •Ö@!$¡Ö Û¼­Ö­ÖDurationÁ®ÖsecsÁâ}¯ÖnanosÁâ}Zµ–²ªü€Ör˜üÀÖ+´ÔÖ|ÔÖ ! éÖB
IœÀÖ
€~Ug êÖü»Ö1 Û¼Ó› ëÖ­ ñÖôÖÍü¼Õ¸Û¼ݼÞ¼©ß¼à¼ÛἈcSñŸ«‡zÙÓ›„éÕ­#l_onoffÁl_lingerÁš~~4ÑÕ32Ó›ywv­#5ßDÂ×t¼×$üרH  úØ “Ù9DÚ× ÛÓ›¼£Ø ”£ØD£Ø 
%<¯
Œ~2L¬Ø ´Øbp ¹Øüç×^  ŠØ ÄØ ¨ÙÎüöÖ²üÕ×pÔž\ª×„žD‹×tÕ×Ó›8!)" Ó›%durationÁL²¢}¬÷Qd÷Q­ÍüÜQ1Ï,ïQ%<­Í16Á¼„c ì|‹cèüéb3Ó{4ûb%9è´Ùd ìtàdÔAü¿d1Ô{4Ðd%9ÔAä«l4«l
œ´l·A Ælü¦l" ø ÇlÎlÖüõkYÎ{$—lÎ{$Žl:·A$µq|µq
 DºqÀ™/Tºq ÃqÊq×üˆqBÎ{$¦qÎ{$qÎ{w3ܰu4°u
”¹uÅ Êuü«u! ø ËuÒuØüöt\Î{$œuÎ{$“u:Å´‡Š4‡Š ! lŠ© œŠ܇Š ¡Š¨ŠÚüщW$ø‰¾|$ž<©´ØŒ4ØŒ ! lጣ íŒÜØŒ òŒùŒÛü¤ŒU$ÉŒ¾|$ÀŒ ž<£Ô§ ! Œ°­ Àü§ ÅÌÜü÷U¾|$¡Ÿ<­äÜ“4Ü“ ! œå“¥ ÷“üÜ“! ü“ƒ”Ýüª“Y$Í“¾|$Ä“¡Ÿ<¥¤¦µ|¦µ ! ¹µD%¬¾µ„¾µ ! ÒµD%$Þµ Û¼Ó›ü£µØR¸ üµ|‚¶ ´‚¶ —¶$¦¶Ì­¶ „®¶
 
! 
 Ŷ
ü­¶   $ɶè#   $èE  ̶ Äܶ ê¶
 
$ï¶ 1
8lܶ
ÿ}
E6 [ ó¶ 
ô×¶ Û¼Ó› ô¶ ú¶ ¦ý¶¹üÚ´£üøµƒü¢¶Y„ž„Œµ­­timevalÁ®tv_secÁ¯tv_usecÁ,áÆ;ïÄ›Dð´ÍÌA@ðÓ›œ²¢xsecÁ¡nsecÁvüß!l°ß$°ß 
&4µß
ØQ3Dµß ¼ß^
eß
­Òr ½ßüƒßB ³ ÄßÇßËüšÝ­³³in_addrÁ´s_addrÁFâ1–œöÏ<ÍÝ ¾º¾ºIpv4AddrÁ¿ºoctetsÁ¯Q5N`hzØÊ$¹Ý]i„»iaddrÁ8Ðl—á$—á 
&4χ
­R3Dœá £áüûà0 ¿ ªá­áÍü¸àu¿¿in6_addrÁÀs6_addrÁÆŒRUN‰Dìà ̺̺Ipv6AddrÁͺ¤º¯QÉ¢}ÝÏÆÚ$Øà+ë½+øº- Lúå|ôå%L·è “\†»¬ñèLüè 
&Tñè
Ë3DL¼æ ù[¬öæLç 
&Töæë¿1B Šçü¦ç"´±ç  Ï„»% 2 I
PT¦çë¿Zl Çç|ãç   Tãç
 
$ 
2 ñç
üÊæ³ Ä üç    !) …鬡éL¬é 
&T¡éë¿1B µéüÅè˜ Ä Ñé Üé æéÏüêäüüŽæïü‡èÖÄÄip_mreqnÁÅ
imr_multiaddrÁÆ imr_addressÁÇ imr_ifindexÁBfÈI^‚­ãtßå„»LŒå ­vL¦åüŽæ8 îź×„»×źš„»„»¢†»¬²çFNG„»°ź˜„»˜źÜ„»Ü„»û multiaddrÁ¿ interfaceÁȓƬ“Æ"£ÖQ†»¸ÀÖQ†»xÏÓ„»¤†»µÖQ†»libc::IFNAMSIZÁTCP_CA_NAME_MAXÁTCP_CA_NAME_MAXÁü·‡%$ˇ ч Õ‡  Ù‡  Z  Û‡  ü–‡Q ® æ‡í‡±üʆ£
È}T$Û†æ†î† ö† sock_filterÁcodeÁjtÁjfÁˆ+[©Û$iÁ^\PD8ÐʪÝÊ®èʲµ÷¤Î@ ìdÕ@Øüµ@.Ð{4Å@%9جÆA ìlÍAàü­A/Ñ{4½A%9à¤éB ìdðBÖüÐB.Ò{4àB%9Ö<þCløC"dØD
Ñ–{d©D
Ж{õDÓü¶C¿{4çCÏs<ÏCŒ”D˜7lЖ{Ñ–{´²K ø„·K¥Jü™K0ÙÎ{$«K%9¥J¬ÃL ø|ÈL¦Jü«L.ÚÎ{$¼L%9¦J¤ƒN øtˆNÏAüìM,ÛÎ{$üM%9ÏAÌìO øœñOÎAüÐO6ÜÎ{$åO%9ÎAœR øl¢Rü‡R*ÝÎ{$R%9ÜãW ŒìWüÆW9ã†|DØW%9ìòX œûXüÕX;ä†|DçX%9ÔÙY „âYü¿Y5å†|DÎY%9Ô½Z „ÆZü£Z5æ†|D²Z%9äÅ[ ”Î[ÿü©[9ç†|Dº[%9ÿÜã\ Œì\ìüÈ\7è†|DØ\%9ìÜœ^ Œ¥^ùü^7é†|D^%9ùôÚ` ¤ã`ûü¼`=ê†|DÏ`%9û¼Øi4Øi tái§ îiäØi óiúiðü¦iT$Éi¾|$Ài9§
$§z Û¼Ó›$š} Û¼Ó›$Œ€  Û¼ü†z• œ š€ ¡€ƒüÙyÈé„dïy„žº„ž¤Û¼ݼÞ¼©ß¼à¼ÛἈcSñŸ«‡zÙÒuT”…$™…  Û¼Ó› üû„A œ„žÇÞ »…Â…ü¼„é„$ì„é„$Ó„Ó›$Ù„„žµÓ›´'¡a)ZD¸  Û¼Ó› Àü–I œ„žÇÞ ÞåüÏŒé„$‡é„$êŒÓ›DðŒ„žµÓ›´'­a)ZlÈ•<Í•  Û¼ Ô•ü¬•G œ„ž„ž ò•ù•üì”é„$é„$†•<Œ•ÇÞ³±%½a(X,àü ¸º&­v18?<ý ¸½&­v1†»9@ŒÅ? ìí%{07>|“J øù%Î{07>œÅV %†|07>¤Öe %¾|07>ü‹k ñò(ññòŽ<ôˆ ëp%×—µícààŽ<âÁÉã«4É(ýÍå!£ªÉñòœìíœøùÀײ¤,IoSliceÁ<•æL PhantomDataÁ\€½éíçë MaybeUninitÁ\úÑÛ
SocketAddrÁT•“¼r,°é!
DerefMutÁD·ö! ßš­Ö c_intÁ,Ê7¿¬Äü\å7'ÆÿLò7&ǯ[Dý7³È¡|‡8(ÉÚ[¼×9¸Êó4€:yËŠ4<™:»Ì¾]lá:×Í€RTË;®Îüáè¾üˆ-* Utilities for creating and using sockets.ÁúüºGD The goal of this crate is to create and use a socket using advancedÁü‚KH configuration options (those that are not available in the types in theÁüÎ41 standard library) without using any unsafe code.Áƒúü‡DA This crate provides as direct as possible access to the system'sÁüÌB? functionality for sockets, this means little effort to provideÁüMJ cross-platform utilities. It is up to the user to know how to use socketsÁüÝJG when using this crate. *If you don't know how to create a socket usingÁü¨HE libc/system calls then this crate is not for you*. Most, if not all,ÁüñIF functions directly relate to the equivalent system call with no errorÁü»PM handling applied, so no handling errors such as [`EINTR`]. As a result usingÁüŒ PM this crate can be a little wordy, but it should give you maximal flexibilityÁüÝ " over configuration of sockets.Á
úü„
.+ [`EINTR`]: std::io::ErrorKind::InterruptedÁ³
ú
 # ExamplesÁÆ
ú

```no_run矯
(% # fn main() -> std::io::Result<()> {Áü ,) use std::net::{SocketAddr, TcpListener};Áü® (% use socket2::{Socket, Domain, Type};Á× úüÛ 41 // Create a TCP listener bound to two addresses.Áü @= let socket = Socket::new(Domain::IPV6, Type::STREAM, None)?;ÁÑ úüÕ  socket.set_only_v6(false)?;Áüõ =: let address: SocketAddr = "[::1]:12345".parse().unwrap();Áü³
" socket.bind(&address.into())?;ÁÄÖ
 socket.listen(128)?;Áï
úüó
.+ let listener: TcpListener = socket.into();Á // ...Á¬­ # drop(listener);Á # Ok(()) }Á ```ÁÚú ## FeaturesÁîúüòPM This crate has a single feature `all`, which enables all functions even onesÁüÃ&# that are not available on all OSs.Át•ÉñòœìíœøùÀ× ×Ø ¤,£éÑ æL½éÆ ½éÙ íÆ ë‚ê» ÑÛ¡ê± “¼r° é!
Ñê¨ ö! ßš§ ­Ö ë¢ ¿¬Äü¡ 'Æÿ  &ǯ[Ÿ ³È¡ž (ÉÚ[ ¸Êóœ yËŠ4»Ì¾]š ×Í€R®ÎR U X D­O „Œ< Äó%  ¬ðî
¤‹×
Ë
Î

¹
œÆ¬
¼ª  ä È  , Œ8!$& 8õ
$“$ , ¡ ¢  , ° ± Â+ ² ³ Á, ´8ê& »8û
Ã, ê8& ï8¼'÷, ú8flagÁ& ÿ8¼,$  ,   $ 
*Ÿ ¢ á
88À±'´8×'¹8p8
Á, Å8! Ë Û
8 Ù8×Ü ß  à8$ å8± ç& è ê8ë8Àï'ò8×ô'÷8ˆ :8ƒ (ˆ8À'Ž8×'8Í4• œ Ñ
8®8stringÁ ¹88 Å7ˆ Æ È ž
, Þ ß Ù
, ù ú + û ü , ý8ê
,  8'¦, ©8…‚*¯8Ô » ¼ Â, ½8…‚$ à Ú8¹ ð*ò88ï2   8± ƒ$ 7{n}Á,†$ Œ% Ÿ8± ± ²8ñ ¼ Ã8»…% ⌞ ° Ž"  Ê , ·8÷$¸& ¼8´¾$ À, Â8
Ã& Æ8´È*Ì Ï "
88Š â, ã8÷ è8
ê, î8
ï ó …"8 8÷$„ ˆ 8Ú4‰& , 8÷$(˜, 8
œ   û!+ ² ³ ó8â´ · ò8º¸ » ñ8ú$ À8£Â Å ð8ú Ð7$ Ø8
Ú Ý ï8î é78"4…  Œ  Ü  ¢ , £ 8
¤  § '¨ 8¶S µ  Ê 8Ú ¼ 8‘S È  É + î  ï  ü 8âð  ó  û 8â8"4Ž! •! í! «!, ¬!8
­! °!'±!8from_raw_socketÁ|³! Â! Û!8Ú4Ã! É!8into_raw_socketÁ|Ê! Ù! Ú!% Œ"dé4Dí4&'(³Ž$šeŽ eí$$ëš<* À¡êTC“¼¸sdOª¼’td]½¼PathÁ$›…0׫¤,ioÁ°¦µ ´AF_UNIXÁ<¹ Öý뿬ü sockaddr_inÁ\Úã  sockaddr_in6Ádçð!½Œ„õË"AF_INETÁ<‡ Ø#ÿAF_INET6ÁD à$æ^4¦ì%æ^í%|ÎD°¤§D8šƒ|s¥gjX[KNœ­;), ïñÛÝÁÃ¥§lŸ•”ü¯>; The integer type used with `getsockname` on this platform.ÁL¤šüº@= The integer type for the `ss_family` field on this platform.Á\£Ô¤üË2/ Rust version of the [`sockaddr_storage`] type.Áþúü‚a^ This type is intended to be used with with direct calls to the `getsockname` syscall. See theÁüä41 documentation of [`SockAddr::new`] for examples.Áúü^[ This crate defines its own `sockaddr_storage` type to avoid semver concerns with upgradingÁ”ü `windows-sys`.ÁÜr+#ií?‡Ò3)ÌÅ((³¤ãÜr+,-¼Â üþ1. Construct a new storage containing all zeros.Á4É Ür**
+üõ
"ü½
%" Returns the size of this storage.Á<ü
¤ ¤Ür* *
,$… üó-üÌ # View this type as another type.Áô ú # SafetyÁ úü• PM The type `T` must be one of the `sockaddr_*` types defined by this platform.Áê ú šõ<…
ÖúÌ‘
 # #[allow(dead_code)]Áü¯
%" # #[cfg(unix)] mod unix_example {ÁìÙ
 # use core::mem::size_of;Áüû
 use libc::sockaddr_storage;ÁüŸ85 use socket2::{SockAddr, SockAddrStorage, socklen_t};ÁÜúüäKH fn from_sockaddr_storage(recv_address: &sockaddr_storage) -> SockAddr {Áü´41 let mut storage = SockAddrStorage::zeroed();ÁüíLI let libc_address = unsafe { storage.view_as::<sockaddr_storage>() };Áü¾&# *libc_address = *recv_address;ÁüéUR unsafe { SockAddr::new(storage, size_of::<sockaddr_storage>() as socklen_t) }Á # }ÁÖú<¥ ¥Ür ¥¥*¥.. Œ*ÍìØ£ 
-Ø£$‘ü¦(Ür0Àc0üÕBئ§¨ ¦Ür § c cˆ¢cµ
 `£cbufÁ `àB¤GS
¨Ö¿Ù¿Ú¿«Û¿ˆÜ¿Ý¿Þ¿ˆ‚†f|Â
ŸÈŸÈ ÈErrorÁ O˜éBL/ Ü/
0± ãs238:;<=>?@ABCDEFü—$MüôC@ Create a `SockAddr` from the underlying storage and its length.Á¼úû›ÕúüÝKH Caller must ensure that the address family and length match the type ofÁü­KH storage address. For example if `storage.ss_family` is set to `AF_INET`ÁüýKH the `storage` must be initialised as `sockaddr_in`, setting the contentÁìÍ and length appropriately.ÁïúšõŠú<’Öúüž(Ôõ¤Ë # #[cfg(unix)] {Á„ä
use std::io;Áìù use std::os::fd::AsRawFd;Áúü£C@ use socket2::{SockAddr, SockAddrStorage, Socket, Domain, Type};Áëúüó@= let socket = Socket::new(Domain::IPV4, Type::STREAM, None)?;Á¸úüÀ=: // Initialise a `SocketAddr` by calling `getsockname(2)`.Áü‚52 let mut addr_storage = SockAddrStorage::zeroed();Áü¼)& let mut len = addr_storage.size_of();ÁêúüòEB // The `getsockname(2)` system call will initialize `storage` forÁü¼ /, // us, setting `len` to the correct length.Á´ð  let res = unsafe {ÁÔ‹! libc::getsockname(Áüª! socket.as_raw_fd(),ÁüÎ!# addr_storage.view_as(),Á¬ö! &mut len,ÁL"4ž" };Á”©" if res == -1 {ÁüÀ"/, return Err(io::Error::last_os_error());Á,ô"‚¢þ"úü†#>; let address = unsafe { SockAddr::new(addr_storage, len) };Á¤É# # drop(address);Á<â#¢dî# # Ok(())Á<ÿ#¢<$Öú«$Ürs11
2·GGü«2üØ%;8 Initialise a `SockAddr` by calling the function `init`.Á˜&úü &LI The type of the address storage and length passed to the function `init`Áüñ&  is OS/architecture specific.Á'úüž'FC The address is zeroed before `init` is called and is thus valid toÁüé'KH dereference and read from. The length initialised to the maximum lengthÁœ¹( of the storage.ÁÑ(údÙ(û›ê(úüò(K¦§üÂ)Kû§ü’*KШìâ*¤©„+útŒ+šõŸ+ú<§+Öúü³+(Ôõ¤à+Šª„ù+§ªìŽ,Àª°,úü¸,2/ use socket2::{SockAddr, Socket, Domain, Type};Áï,úü÷,@Ì«¼-úüÄ-=¢¬ü†. let (_, address) = unsafe {Áüª.0- SockAddr::try_init(|addr_storage, len| {Áüß.MJ // The `getsockname(2)` system call will initialize `storage` forÁü±/74 // us, setting `len` to the correct length.Áüí/VS if libc::getsockname(socket.as_raw_fd(), addr_storage.cast(), len) == -1 {ÁüÈ0/, Err(io::Error::last_os_error())Á¤ü0 } else {Á´•1 Ok(())Ál°1
TÂ1 })Á<Ñ1 }?;Á¤Ý1ú±<ö1¢d2¤²<“2¢<Ÿ2ÖúD¹2Ö¿Ù¿Ú¿«Û¿ˆÜ¿Ý¿Þ¿ˆ‚†f|Â
¥sßß±¥à ¬
ÑøÿËO Ÿ14¥5541ÍìÕ¾ Â2Í쪿 Å2–"Õ¾ Ür üƒ3=Õ¾·À˜"Ö¿Ù¿Ú¿«Û¿ˆÜ¿Ý¿Þ¿ˆ‚†f|Â
ª¿²¿l³3
3Õ¾ª¿initÁ$È2²´®°ìÐ3dÖ3,·73<closure_kind>Á7<closure_signature>Á7<upvars>Á7737Õ¾ª¿ª¿¨¿èÅÜrü:QüÑ8LI Constructs a `SockAddr` with the family `AF_UNIX` and the provided path.Á¢9úüª9:7 Returns an error if the path is longer than `SUN_LEN`.Áú”ó9¤ò9üé9$”:¡Ö¿Ù¿Ú¿«Û¿ˆÜ¿Ý¿Þ¿ˆ‚†f|Â
s²¿1¡991ÍìèÄ ™:àèÄ…0…0õ†0ß-bªŸðcÂ^\Ò:
8èÄõ
$œ:SUüÌ<6ü¡;" Set the length of the address.ÁÈ;údÐ;û›á;úüé;IF Caller must ensure that the address up to `length` bytes are properlyÁ„·<
initialised.ÁTÚ<© ©s1 å<1
:$ê<ñ]4ð<üÒ=)ü«=" Returns this address's family.Á4ß=ª ªs1 æ=1
;$ç=üÑ>$ü¨>$! Returns this address's `Domain`.Á4Þ>« «s{1 å>1
<$æ>üæ?$ü³?.+ Returns the size of this address in bytes.Áó?¬ ¬s1 ÷?1
=$ø?ü×@4ü©@)& Returns a raw pointer to the address.Á4ä@­ ­s‹”1 ë@1
>$ì@üB0üäA'$ Returns the address as the storage.ÁTBsÜr11
?`JüîC#ü•CTQ Returns true if this address is in the `AF_INET` (IPv4) family, false otherwise.Á<ûC® ®s1 ƒD1
@$„DüºE#üØDJG Returns true if this address is in the `AF_INET6` (IPv6) family, falseÁt§E otherwise.Á<ÇE¯ ¯s1 ÏE1
A$ÐEìéGü¥F\Y Returns true if this address is of a unix socket (for local interprocess communication),Áü†G:7 i.e. it is from the `AF_UNIX` family, false otherwise.Áú”ÏG¤ÎGüÅG<ðG° °s1 øG1
B$ùGüÜI-üÍHKH Returns this address as a `SocketAddr` if it is in the `AF_INET` (IPv4)ÁüI:7 or `AF_INET6` (IPv6) family, otherwise returns `None`.ÁLãI± ±sÛ¼ݼÞ¼©ß¼à¼ÛἈcSñŸ«‡zÙÏs1 íI1
C$îIüçT4üŠTHE Returns this address as a [`SocketAddrV4`] if it is in the `AF_INET`Á\×T family.ÁtîT² ²sÛ¼ݼÞ¼©ß¼à¼ÛἈcSñŸ«‡zÙ¬t1 ýT1
D$þTüÿV4ü¡VIF Returns this address as a [`SocketAddrV6`] if it is in the `AF_INET6`Á\ïVéÔt†W³ ³sÛ¼ݼÞ¼©ß¼à¼ÛἈcSñŸ«‡zÙ†u1 •W1
E$WÜèXDëX´ ´s ´
1 ôX1
F$õXü¬["sHëHüÕ[%$Ø[ÏssGG
Høº$Ý[ü‡]$sJëJü²]'$µ]¬tsII
Jøº$º]üƒg$sLëLü®g'$±g†usKK
Løº$¶gä”ssNÀcNü·s:ºsµ· µs  c cˆ¢cµ
 `£c¨¤ `àB¤GS
·Ï¥M ¾sM
N$¿s×ÅsÜ©ysP·ßPüËy"Îy¸¹ ¸s ¹sO ÑyO
P$Òy¹
,Øy¤¥zs´¾zsSeSüÛz3$Þzº» ºs »RTT ùzRÍì˜ß ãz¢e˜ßŒæz
S˜ß$úzº,€{+-T÷44û4¬Íθ×ê¤,UVŸ‘¦UXReadÁ$ƒà UYWriteÁ,‰Ÿ!UZ£éæLU\
IoSliceMutÁTùö U]‚ê\”ÑÛU^ù¼̺U_netÁ$ž"Ua’ºD‡¾ºUbShutdownÁD¶MUc FromRawFdÁLñ­+Ue IntoRawFdÁLü¯+Ufßš­ÖUg5$ýÉUi뿬Ujü‰ETŠ ÅUk¨ET ÈUlX$¢ÌUmãYLüœUnæ^4“ìUpæ^íUpô_DUqô_Uq¯[D¥³UrÈad¯œUsóøUtóùUtŽ<„¡ ñUvŽ<òUvöW4³ UwÀ`L» UxÀ`UxDå·ªøšˆ~gj¬Š]”ÞO?û25

ô÷œÖêÝ÷ÐÓ¾Á±´¥¨„õœ,‹psPS?B25,™ öøçéŒúüÈ )& Owned wrapper around a system socket.Áò úüö MJ This type simply wraps an instance of a file descriptor (`c_int`) on UnixÁüÄ
MJ and an instance of `SOCKET` on Windows. This is the main type exported byÁü’ HE this crate and is intended to mirror the raw semantics of sockets onÁüÛ FC platforms as closely as possible. Almost all methods correspond toÁü¢ IF precisely one libc or OS API call which is essentially just a "RusticÁüì ! translation" of what's below.ÁŽ
úü’
)& ## Converting to and from other typesÁ¼
úüÀ
MJ This type can be freely converted into the network primitives provided byÁüŽKH the standard library, such as [`TcpStream`] or [`UdpSocket`], using theÁüÚ*' [`From`] trait, see the example below.Áúü‰&# [`TcpStream`]: std::net::TcpStreamÁü°&# [`UdpSocket`]: std::net::UdpSocketÁ×ú # NotesÁçúüëMJ Some methods that set options on `Socket` require two system calls to setÁü¹KH their options without overwriting previously set options. We do this byÁü…NK first getting the current settings, applying the desired changes, and thenÁüÔPM updating the settings. This means that the operation is **not** atomic. ThisÁü¥NK can lead to a data race when two threads are changing options in parallel.Áôúšõl‡½õü•(Ôõü¾,†öüë(¼öúä˜ // create a TCP listenerÁüµ@¸÷öúüú=·øü¸! let address = address.into();ÁÜÚ socket.bind(&address)?;ÁÄö©ùúü“.×ùŽú¬Í¡ú¿úÖú4…šwýÎ}AƒÏz”’,Uyyâ~\©šw|}~ƒˆŠŽ˜šœžŸ ¡¢£¤¥¦§¨©ªüà5šw{{
|@÷ü¬-¼ ¼šw{ Á{
}ü.Dšw{{
~üÛ"Vüô/, Creates a new socket and sets common flags.Á¨úü°HE This function corresponds to `socket(2)` on Unix and `WSASocketW` onÁ Windows.ÁŽ úü– JG On Unix-like systems, the close-on-exec flag is set on the new socket.Áüå IF Additionally, on Apple platforms `SOCK_NOSIGPIPE` is set. On Windows,Áü³!'$ the socket is made non-inheritable.Áß!úüç!LI [`Socket::new_raw`] can be used if you don't want these flags to be set.Áø3Ç#Ÿô¸" 
Additional documentation can be found in manual of the OS:
* DragonFly BSD: <https://man.dragonflybsd.org/?command=socket&section=2>
* FreeBSD: <https://www.freebsd.org/cgi/man.cgi?query=socket&sektion=2>
* Linux: <https://man7.org/linux/man-pages/man2/socket.2.html>
* macOS: <https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/socket.2.html> (archived, actually for iOS)
* NetBSD: <https://man.netbsd.org/socket.2>
* OpenBSD: <https://man.openbsd.org/socket.2>
* iOS: <https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/socket.2.html> (archived)
* illumos: <https://illumos.org/man/3SOCKET/socket>
* Windows: <https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-socket>
Áâ"–{Î{Û¼ݼÞ¼©ß¼à¼ÛἈcSñŸ«‡zÙ†|Ö¿Ù¿Ú¿«Û¿ˆÜ¿Ý¿Þ¿ˆ‚†f|Â
šw²¿{{
è4æ"´ö"àGD€#ü‰&Zü®$0- Creates a new socket ready to be configured.Áã$úüë$Hå÷ü¸%LI Windows and simply creates a new socket, no other configuration is done.Á<&–{Î{Ø‚Ÿƒ{{
è4˜&´¨&àGD²&'“Á«ÁÈÁ†|üá*€üé'@= Creates a pair of sockets which are connected to each other.Á®(úü¶(1. This function corresponds to `socketpair(2)`.Áì(úüô(EB This function sets the same flags as in done for [`Socket::new`],Áü¾)JG [`Socket::pair_raw`] can be used if you don't want to set those flags.ÁøHÅ%hü*(ã
Additional documentation can be found in manual of the OS:
* DragonFly BSD: <https://man.dragonflybsd.org/?command=socketpair&section=2>
* FreeBSD: <https://www.freebsd.org/cgi/man.cgi?query=socketpair&sektion=2>
* Linux: <https://man7.org/linux/man-pages/man2/socketpair.2.html>
* macOS: <https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/socketpair.2.html> (archived, actually for iOS)
* NetBSD: <https://man.netbsd.org/socketpair.2>
* OpenBSD: <https://man.openbsd.org/socketpair.2>
* iOS: <https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/socketpair.2.html> (archived)
* illumos: <https://illumos.org/man/3SOCKET/socketpair>
Á»£|Ä*ú$Õ*¼Ã*üº*"$è*–{Î{؂ֿٿڿ«Û¿ˆÜ¿Ý¿Þ¿ˆ‚†f|Â
šwšw²¿{{
è4ö*´Ž+àGD +üÜ.„ü²-@“†÷-úüÿ-1醻£|¿.ú$Ð.¼¾.üµ."Dã.–{Î{Ø‚{{
ƒè4õ.´/àGDŸ/0ƒ“Á«ÁÈÁƒó†DÚ0ƒ“Á«ÁÈÁƒÐüÙ28üš1/, Binds this socket to the specified address.ÁÎ1úüÖ1KH This function directly corresponds to the `bind(2)` function on WindowsÁl¦2
and Unix.Áø`Ç#Ÿä¸2Ž
Additional documentation can be found in manual of the OS:
* DragonFly BSD: <https://man.dragonflybsd.org/?command=bind&section=2>
* FreeBSD: <https://www.freebsd.org/cgi/man.cgi?query=bind&sektion=2>
* Linux: <https://man7.org/linux/man-pages/man2/bind.2.html>
* macOS: <https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/bind.2.html> (archived, actually for iOS)
* NetBSD: <https://man.netbsd.org/bind.2>
* OpenBSD: <https://man.openbsd.org/bind.2>
* iOS: <https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/bind.2.html> (archived)
* illumos: <https://illumos.org/man/3SOCKET/bind>
* Windows: <https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-bind>
Á$à2½¾ ½šw ¾sÖ¿Ù¿Ú¿«Û¿ˆÜ¿Ý¿Þ¿ˆ‚†f|Â
²¿{ å2{
$æ2˜<ì2üä:;üÉ3B? Initiate a connection on this socket to the specified address.Á4úü˜4FC This function directly corresponds to the `connect(2)` function onÁ¬ã4 Windows and Unix.Áý4úü…5GD An error will be returned if `listen` or `connect` has already beenÁÜÑ5 called on this builder.ÁøxÇ#Ÿüñ5©
Additional documentation can be found in manual of the OS:
* DragonFly BSD: <https://man.dragonflybsd.org/?command=connect&section=2>
* FreeBSD: <https://www.freebsd.org/cgi/man.cgi?query=connect&sektion=2>
* Linux: <https://man7.org/linux/man-pages/man2/connect.2.html>
* macOS: <https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/connect.2.html> (archived, actually for iOS)
* NetBSD: <https://man.netbsd.org/connect.2>
* OpenBSD: <https://man.openbsd.org/connect.2>
* iOS: <https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/connect.2.html> (archived)
* illumos: <https://illumos.org/man/3SOCKET/connect>
* Windows: <https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-connect>
Á•6ú\6Øí­6úüµ6A> When using a non-blocking connect (by setting the socket intoÁüû6KH non-blocking mode before calling this function), socket option can't beÁüË7EB set *while connecting*. This will cause errors on Windows. SocketÁü•8EB options can be safely set before and after connecting the socket.Áß8úüç8KH On Cygwin, a Unix domain socket connect blocks until the server acceptsÁü·9HE it. If the behavior is not expected, try [`Socket::set_no_peercred`]Á”„: (Cygwin only).Á<ë:¿À ¿šw Às‰œ{ ó:{
$ô:˜<ú:ü¬CSüÚ;GD Initiate a connection on this socket to the specified address, onlyÁü¦<FC only waiting for a certain period of time for the connection to beÁ„ñ<
established.Á†=úüŽ=JG Unlike many other methods on `Socket`, this does *not* correspond to aÁüÝ=KH single C function. It sets the socket to nonblocking mode, connects viaÁü­>JG connect(2), and then waits for the connection to complete with poll(2)Áüü>GD on Unix and select on Windows. When the connection is complete, theÁüÈ?EB socket is set back to blocking mode. On Unix, this will loop overÁœ’@ `EINTR` errors.Áª@út²@ # WarningsÁÅ@úüÍ@IF The non-blocking state of the socket is overridden by this function -Áü›ALI it will be returned in blocking mode on success, and in an indeterminateÁ¬ìA state on failure.Á†BúüŽBJG If the connection request times out, it may still be processing in theÁüÝBJG background - a second call to `connect` or `connect_timeout` may fail.Á|³CÁ Ášw ÂsÓ›‰œ{ ÃC{
ˆ$ÄCøº$ÊCtimeoutÁ<ÛCüßJ6üòGGD Mark a socket as ready to accept incoming connection requests usingÁ̾H [`Socket::accept()`].ÁÜHúüäHEB This function directly corresponds to the `listen(2)` function onÁ¬®I»ÈIúüÐIGæÜœJ¶žøÇ#Ÿô¼J 
Additional documentation can be found in manual of the OS:
* DragonFly BSD: <https://man.dragonflybsd.org/?command=listen&section=2>
* FreeBSD: <https://www.freebsd.org/cgi/man.cgi?query=listen&sektion=2>
* Linux: <https://man7.org/linux/man-pages/man2/listen.2.html>
* macOS: <https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/listen.2.html> (archived, actually for iOS)
* NetBSD: <https://man.netbsd.org/listen.2>
* OpenBSD: <https://man.openbsd.org/listen.2>
* iOS: <https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/listen.2.html> (archived)
* illumos: <https://illumos.org/man/3SOCKET/listen>
* Windows: <https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-listen>
Á4æJà Úw‰œ{ íJ{
$îJbacklogÁ<ôJüëP6üÏK85 Accept a new incoming connection from this listener.ÁŒLúü”LDA This function uses `accept4(2)` on platforms that support it andÁüÝL&# `accept(2)` platforms that do not.ÁˆMúüME°‡üÚMLI [`Socket::accept_raw`] can be used if you don't want to set those flags.Áø¨Ç#Ÿô«N 
Additional documentation can be found in manual of the OS:
* DragonFly BSD: <https://man.dragonflybsd.org/?command=accept&section=2>
* FreeBSD: <https://www.freebsd.org/cgi/man.cgi?query=accept&sektion=2>
* Linux: <https://man7.org/linux/man-pages/man2/accept.2.html>
* macOS: <https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/accept.2.html> (archived, actually for iOS)
* NetBSD: <https://man.netbsd.org/accept.2>
* OpenBSD: <https://man.openbsd.org/accept.2>
* iOS: <https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/accept.2.html> (archived)
* illumos: <https://illumos.org/man/3SOCKET/accept>
* Windows: <https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-accept>
ÁÎNú\ÖNØíæNúüîNK‡¨ü¾OHܨ”‹P­©4òPÄ ÄšwÖ¿Ù¿Ú¿«Û¿ˆÜ¿Ý¿Þ¿ˆ‚†f|Â
šws²¿{ ùP{
Š$úPüå\:ü¼[8ô¼ù[úü\EB This function directly corresponds to the `accept(2)` function onÁ¬Ë\»Tì\Å ÅšwÒÇ{ ÷\{
$ø\|É]“ÁŒ«ÁŒÈÁŒŒŒs Èü„a0ü…^@= Returns the socket address of the local half of this socket.ÁÊ^úüÒ^JG This function directly corresponds to the `getsockname(2)` function onÁ¬¡_»øÀÇ#Ÿü»_#Í
Additional documentation can be found in manual of the OS:
* DragonFly BSD: <https://man.dragonflybsd.org/?command=getsockname&section=2>
* FreeBSD: <https://www.freebsd.org/cgi/man.cgi?query=getsockname&sektion=2>
* Linux: <https://man7.org/linux/man-pages/man2/getsockname.2.html>
* macOS: <https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/getsockname.2.html> (archived, actually for iOS)
* NetBSD: <https://man.netbsd.org/getsockname.2>
* OpenBSD: <https://man.openbsd.org/getsockname.2>
* iOS: <https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/getsockname.2.html> (archived)
* illumos: <https://illumos.org/man/3SOCKET/getsockname>
* Windows: <https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-getsockname>
Áã_ú\ë_Øíû_úüƒ`EB Depending on the OS this may return an error if the socket is notÁdÍ` [bound].ÁÞ`úÌæ` [bound]: Socket::bindÁTaÆ ÆšwíÄ{ –a{
$—aüÚd/üêaA> Returns the socket address of the remote peer of this socket.Á°búü¸bJG This function directly corresponds to the `getpeername(2)` function onÁ¬‡c»øØÇ#Ÿü¡c#Í
Additional documentation can be found in manual of the OS:
* DragonFly BSD: <https://man.dragonflybsd.org/?command=getpeername&section=2>
* FreeBSD: <https://www.freebsd.org/cgi/man.cgi?query=getpeername&sektion=2>
* Linux: <https://man7.org/linux/man-pages/man2/getpeername.2.html>
* macOS: <https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/getpeername.2.html> (archived, actually for iOS)
* NetBSD: <https://man.netbsd.org/getpeername.2>
* OpenBSD: <https://man.openbsd.org/getpeername.2>
* iOS: <https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/getpeername.2.html> (archived)
* illumos: <https://illumos.org/man/3SOCKET/getpeername>
* Windows: <https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-getpeername>
ÁÉcú\ÑcØíácúüéc=: This returns an error if the socket is not [`connect`ed].Á«dúü³d" [`connect`ed]: Socket::connectÁLádÇ ÇšwíÄ{ ëd{
Ž$ìdü¤f(ü¿eKH Returns the [`Type`] of this socket by checking the `SO_TYPE` option onÁf
this socket.Á4«fÈ ÈšwÖ¿Ù¿Ú¿«Û¿ˆÜ¿Ý¿Þ¿ˆ‚†f|Â
Î{²¿{ ²f{
$³füòk-ü¹gFC Creates a new independently owned handle to the underlying socket.Á„hú\ŒhØíœhúü¤hIF On Unix this uses `F_DUPFD_CLOEXEC` and thus sets the `FD_CLOEXEC` onÁÄòh the returned socket.Áiúü—iKH On Windows this uses `WSA_FLAG_NO_HANDLE_INHERIT` setting inheriting toÁTçi false.ÁöiúüþiDA On Windows this can **not** be used function cannot be used on aÁÜÇj QOS-enabled socket, seeÁüçjb_ <https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-wsaduplicatesocketw>.Áú”Øk¤×küÎkLùkÉ ÉšwŸƒ{ ƒl{
$„lü‚p-üélLI Returns true if this socket is set to nonblocking mode, false otherwise.Áºmú\ÂmØíÒmúüÚmFC On Unix this corresponds to calling `fcntl` returning the value ofÁŒ¥n `O_NONBLOCK`.Á»núüÃnGD On Windows it is not possible retrieve the nonblocking mode status.Á»£|¢oú$¿oú”ÉoîŒáoœàoüÈo,ü¾o7ü˜ocüon\‰pÊ ÊšwÖ¿Ù¿Ú¿«Û¿ˆÜ¿Ý¿Þ¿ˆ‚†f|Â
²¿{ •p{
$püòrBüåp63 Moves this socket into or out of nonblocking mode.Á qú\¨qØí¸qúüÀqIF On Unix this corresponds to calling `fcntl` (un)setting `O_NONBLOCK`.ÁŽrúü–rDA On Windows this corresponds to calling `ioctlsocket` (un)settingÁtßr `FIONBIO`.Á|ùrË Ëšw‰œ{ ‰s{
$Šs
\süþu7üûsB? Shuts down the read, write, or both halves of this connection.ÁÂtúüÊtHE This function will cause all pending and future I/O on the specifiedÁü—u=: portions to return immediately with an appropriate value.ÁøðÇ#ŸüÙu ²
Additional documentation can be found in manual of the OS:
* DragonFly BSD: <https://man.dragonflybsd.org/?command=shutdown&section=2>
* FreeBSD: <https://www.freebsd.org/cgi/man.cgi?query=shutdown&sektion=2>
* Linux: <https://man7.org/linux/man-pages/man2/shutdown.2.html>
* macOS: <https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/shutdown.2.html> (archived, actually for iOS)
* NetBSD: <https://man.netbsd.org/shutdown.2>
* OpenBSD: <https://man.openbsd.org/shutdown.2>
* iOS: <https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/shutdown.2.html> (archived)
* illumos: <https://illumos.org/man/3SOCKET/shutdown>
* Windows: <https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-shutdown>
ÁD…vÌ Ìšw¶M·M¸MÄß¹MºMÛß»M¼MBothÁlÏÏ‘£A2͉œ{ Žv{
$vhowÁ•vüµ~DüívFC Receives data on the socket from the remote address to which it isÁt¸w connected.ÁËwúüÓwHE The [`connect`] method will connect this socket to a remote address.Áü x:7 This method might fail if the socket is not connected.ÁøˆÇ#ŸäßxŽ
Additional documentation can be found in manual of the OS:
* DragonFly BSD: <https://man.dragonflybsd.org/?command=recv&section=2>
* FreeBSD: <https://www.freebsd.org/cgi/man.cgi?query=recv&sektion=2>
* Linux: <https://man7.org/linux/man-pages/man2/recv.2.html>
* macOS: <https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/recv.2.html> (archived, actually for iOS)
* NetBSD: <https://man.netbsd.org/recv.2>
* OpenBSD: <https://man.openbsd.org/recv.2>
* iOS: <https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/recv.2.html> (archived)
* illumos: <https://illumos.org/man/3SOCKET/recv>
* Windows: <https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-recv>
Á€yúüˆy  [`connect`]: Socket::connectÁ­yúdµyû›ÆyúüÎyGD Normally casting a `&mut [u8]` to `&mut [MaybeUninit<u8>]` would beÁüšzJG unsound, as that allows us to write uninitialised bytes to the buffer.ÁüézLI However this implementation promises to not write uninitialised bytes toÁüº{FC the `buf`fer and passes it directly to `recv(2)` system call. ThisÁü…|HE promise ensures that this function can be called using a `buf`fer ofÁ¬Ò| type `&mut [u8]`.Áì|úüô|LI Note that the [`io::Read::read`] implementation calls this function withÁüÅ}KH a `buf`fer of type `&mut [u8]`, allowing initialised buffers to be usedÁÜ•~ without using `unsafe`.Á$¼~ÍÎ Íšw Î
ÑÛÑÛ‚êÓÛuninitÁÝÔÛ»ÝÍõƒ«%9Ö¿Ù¿Ú¿«Û¿ˆÜ¿Ý¿Þ¿ˆ‚†f|Â
²¿{ Á~{
$Â~¨¤È~üç‚Pü¬LI Receives out-of-band (OOB) data on the socket from the remote address toÁüýFC which it is connected by setting the `MSG_OOB` flag for this call.ÁÈ€úüЀ?< For more information, see [`recv`], [`out_of_band_inline`].ÁúÔœ [`recv`]: Socket::recvÁü»63 [`out_of_band_inline`]: Socket::out_of_band_inlineÁú”Í‚¤Ì‚ü„î‚ÏÐ Ïšw Ðᆪ‡{ ÿ‚{
$€ƒ¨¤†ƒü‘…üõƒLI Identical to [`recv`] but allows for specification of arbitrary flags toÁüÆ„ the underlying `recv` call.Áê„úÔò„Á‰|˜…ÑÒ Ñšw Òᆪ‡{ ±…{
$²…¨¤À…ØZ,å…ü“‘wü͆F—÷ü˜‡DA connected. Unlike [`recv`] this allows passing multiple buffers.Áá‡úüé‡HŠøü¶ˆ:ÜøõˆúüýˆLI In addition to the number of bytes read, this function returns the flagsÁüΉJG for the received message. See [`RecvFlags`] for more information aboutÁ¼Š the returned flags.Áø Ç#Ÿü¹Š©
Additional documentation can be found in manual of the OS:
* DragonFly BSD: <https://man.dragonflybsd.org/?command=recvmsg&section=2>
* FreeBSD: <https://www.freebsd.org/cgi/man.cgi?query=recvmsg&sektion=2>
* Linux: <https://man7.org/linux/man-pages/man2/recvmsg.2.html>
* macOS: <https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/recvmsg.2.html> (archived, actually for iOS)
* NetBSD: <https://man.netbsd.org/recvmsg.2>
* OpenBSD: <https://man.openbsd.org/recvmsg.2>
* iOS: <https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/recvmsg.2.html> (archived)
* illumos: <https://illumos.org/man/3SOCKET/recvmsg>
* Windows: <https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-recvmsg>
ÁÝŠúÔåŠÁ‰ü„‹ Îÿ©‹úd±‹û›‹úüÊ‹KH Normally casting a `IoSliceMut` to `MaybeUninitSlice` would be unsound,ÁüšŒIF as that allows us to write uninitialised bytes to the buffer. HoweverÁüèŒHE this implementation promises to not write uninitialised bytes to theÁüµKH `bufs` and passes it directly to `recvmsg(2)` system call. This promiseÁü…ŽGD ensures that this function can be called using `bufs` of type `&mutÁ”ÑŽ [IoSliceMut]`.ÁèŽúüðŽGD Note that the [`io::Read::read_vectored`] implementation calls thisÁü¼JG function with `buf`s of type `&mut [IoSliceMut]`, allowing initialisedÁü‹.+ buffers to be used without using `unsafe`.ÁúredoxÁœÌú”áúhorizonÁ¬õüË@üÇEü¾Plš‘ÓÔÕ Óšw Ô
ññòŽ<ôˆ ëp%×—µíÕÖ¿Ù¿Ú¿«Û¿ˆÜ¿Ý¿Þ¿ˆ‚†f|Â
¾|²¿{ ±‘{
$²‘bufsÁ$À‘ü§–˜üÇ’LI Identical to [`recv_vectored`] but allows for specification of arbitraryÁü˜“52 flags to the underlying `recvmsg`/`WSARecv` call.ÁÒ“úüÚ“,) [`recv_vectored`]: Socket::recv_vectoredÁ‹”úd“”û›¤”úü¬”JG `recv_from_vectored` makes the same safety guarantees regarding `bufs`ÁÌû” as [`recv_vectored`].Á™•úü¡•,é úóœœà•ú”õ•ú¬‰–üß•@üÛ•EüÒ•PÄ®–Öר Öšw ×
ññòŽ<ôˆ ëp%×—µíجŸ{ Ж{
˜$Ñ–§Ÿ$ß–ØZ,Š—üƒœDü„˜F—÷üϘEB connected, without removing that data from the queue. On success,Áü™™'$ returns the number of bytes peeked.ÁÅ™úüÍ™JG Successive calls return the same data. This is accomplished by passingÁüœš>; `MSG_PEEK` as a flag to the underlying `recv` system call.Áßšúdçšû›øšúü€›EB `peek` makes the same safety guarantees regarding the `buf`fer asÁlÊ›
[`recv`].ÁÜ›úÔä›Á‰$ŠœÙÚ Ùšw Úᆪ‡{ œ{
$œ¨¤–œüÛŸUü†JG Receives data from the socket. On success, returns the number of bytesÁüÕ30 read and the address from whence the data came.Áø¸Ç#Ÿüž ²
Additional documentation can be found in manual of the OS:
* DragonFly BSD: <https://man.dragonflybsd.org/?command=recvfrom&section=2>
* FreeBSD: <https://www.freebsd.org/cgi/man.cgi?query=recvfrom&sektion=2>
* Linux: <https://man7.org/linux/man-pages/man2/recvfrom.2.html>
* macOS: <https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/recvfrom.2.html> (archived, actually for iOS)
* NetBSD: <https://man.netbsd.org/recvfrom.2>
* OpenBSD: <https://man.openbsd.org/recvfrom.2>
* iOS: <https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/recvfrom.2.html> (archived)
* illumos: <https://illumos.org/man/3SOCKET/recvfrom>
* Windows: <https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-recvfrom>
Á²žúdºžû›ËžúüÓžJG `recv_from` makes the same safety guarantees regarding the `buf`fer asÁl¢Ÿ‰¨´ŸúÔ¼ŸÁ‰LâŸÛÜ Ûšw Üá†Ö¿Ù¿Ú¿«Û¿ˆÜ¿Ý¿Þ¿ˆ‚†f|Â
s²¿{ ìŸ{
š$ퟨ¤óŸü—¢üè HE Identical to [`recv_from`] but allows for specification of arbitraryÁüµ¡,) flags to the underlying `recvfrom` call.Áæ¡úüî¡$! [`recv_from`]: Socket::recv_fromÁ¤ž¢ÝÞ Ýšw Þá†á³{ ¼¢{
$½¢¨¤Ë¢ØZ,ð¢ü«¨üä£HE Receives data from the socket. Returns the amount of bytes read, theÁü±¤HE [`RecvFlags`] and the remote address from the data is coming. UnlikeÁüþ¤74 [`recv_from`] this allows passing multiple buffers.ÁøÐÇ#Ÿüº¥»Þ¥úüæ¥$޵¦úd—¦û›¨¦úü°¦JÈ¡Ìÿ¦œ¢§úü¥§,é úóœœä§ú”ù§ú¬¨üã§@üß§EüÖ§P”²¨ßàá ßšw à
ññòŽ<ôˆ ëp%×—µíáÖ¿Ù¿Ú¿«Û¿ˆÜ¿Ý¿Þ¿ˆ‚†f|Â
¾|s²¿{ Ψ{
œ$Ϩ§Ÿ$ݨüæ­§üó©GD Identical to [`recv_from_vectored`] but allows for specification ofÁü¿ªC@ arbitrary flags to the underlying `recvmsg`/`WSARecvFrom` call.Á‡«úü«63 [`recv_from_vectored`]: Socket::recv_from_vectoredÁÊ«údÒ«û›ã«úüë«JÈ¡̺¬œ¢جúüà¬,é ú󜜟­ú”´­ú¬È­üž­@üš­Eü‘­Pìí­âãä âšw ã
ññòŽ<ôˆ ëp%×—µíäå»{ ”®{
$•®§Ÿ$£®ØZ,ήüç¹UüׯFC Receives data from the socket, without removing it from the queue.Á¢°úüª°Jô¥üù°B? `MSG_PEEK` as a flag to the underlying `recvfrom` system call.ÁÀ±úüȱGD On success, returns the number of bytes peeked and the address fromÁÌ”² whence the data came.Á²²údº²û›˲úüÓ²JG `peek_from` makes the same safety guarantees regarding the `buf`fer asÁl¢³‰¨´³úä¼³ # Note: Datagram SocketsÁüݳPM For datagram sockets, the behavior of this method when `buf` is smaller thanÁü²´MJ the datagram at the head of the receive queue differs between Windows andÁü„µNK Unix-like platforms (Linux, macOS, BSDs, etc: colloquially termed "*nix").Á×µúüßµHE On *nix platforms, the datagram is truncated to the length of `buf`.Á¬¶úü´¶IF On Windows, an error corresponding to `WSAEMSGSIZE` will be returned.Á‚·úüŠ·^[ For consistency between platforms, be sure to provide a sufficiently large buffer to avoidÁüí·KH truncation; the exact size required depends on the underlying protocol.Á½¸úüŸIF If you just want to know the sender of the data, try [`peek_sender`].Á“¹úÔ›¹Á‰üº¹(% [`peek_sender`]: Socket::peek_senderÁLî¹åæ åšw æá†á³{ ø¹{
ž$ù¹¨¤ÿ¹ü½1ü€»FC Retrieve the sender for the data at the head of the receive queue.ÁË»úüÓ»IF This is equivalent to calling [`peek_from`] with a zero-sized buffer,Áü¡¼63 but suppresses the `WSAEMSGSIZE` error on Windows.Áܼúüä¼$! [`peek_from`]: Socket::peek_fromÁ\”½ç çšwíÄ{  ½{
Ÿ$¡½üüÁ^üô½>; Receive a message from a socket using a message structure.Á·¾úü¿¾KH This is not supported on Windows as calling `WSARecvMsg` (the `recvmsg`Áü¿74 equivalent) is not straight forward on Windows. SeeÁüË¿˜ <https://github.com/microsoft/Windows-classic-samples/blob/7cbd99ac1d2b4a0beffbaba29ea63d024ceff700/Samples/Win7Samples/netds/winsock/recvmsg/rmmc.cpp>ÁäëÀ for an example (in C++).ÁøèÇ#ŸüŒÁ»ú$ºÁúóœœÈÁú¬ÝÁüÇÁ,üÃÁ1ü¹Á<ü°ÁG<ƒÂèéêëì èšw 霜ãY ¡¶XœB6I‰æGêë쪇{ ‹Â{
 $ŒÂmsgÁ’ÂØZ,³Âü£Å3ü˜Ã1. Sends data on the socket to a connected peer.ÁÎÃúüÖÃHE This is typically used on TCP sockets or datagram sockets which haveÁœ£Ä been connected.Á»ÄúüÃÄ:7 On success returns the number of bytes that were sent.Áø€Ç#Ÿä‚ÅŽ
Additional documentation can be found in manual of the OS:
* DragonFly BSD: <https://man.dragonflybsd.org/?command=send&section=2>
* FreeBSD: <https://www.freebsd.org/cgi/man.cgi?query=send&sektion=2>
* Linux: <https://man7.org/linux/man-pages/man2/send.2.html>
* macOS: <https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/send.2.html> (archived, actually for iOS)
* NetBSD: <https://man.netbsd.org/send.2>
* OpenBSD: <https://man.openbsd.org/send.2>
* iOS: <https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/send.2.html> (archived)
* illumos: <https://illumos.org/man/3SOCKET/send>
* Windows: <https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-send>
Á$ªÅíî íšw î±Ùª‡{ ¯Å{
¡$°Å¨¤¶Åü¥ÇLü‰Æ[X Identical to [`send`] but allows for specification of arbitrary flags to the underlyingÁ„éÆ
`send` call.ÁþÆú [`send`]: Socket::sendÁ|¬Çïð ïšw ð±Ùª‡{ ¼Ç{
¢$½Ç¨¤ÃÇØZ,ÏÇüÏÉFü¬ÈIF Send data to the connected peer. Returns the amount of bytes written.Áú󜜈ÉúÉú¬±Éü‡É@üƒÉEüúÈPlÖÉñòó ñšw ò
æLæLçL£ééLˆ¦ —óë@M$Tóª‡{ äÉ{
£$åɧŸ$ëÉüÍ~üÒÊLI Identical to [`send_vectored`] but allows for specification of arbitraryÁü£Ë52 flags to the underlying `sendmsg`/`WSASend` call.Áø˜Ç#ŸüÝË©
Additional documentation can be found in manual of the OS:
* DragonFly BSD: <https://man.dragonflybsd.org/?command=sendmsg&section=2>
* FreeBSD: <https://www.freebsd.org/cgi/man.cgi?query=sendmsg&sektion=2>
* Linux: <https://man7.org/linux/man-pages/man2/sendmsg.2.html>
* macOS: <https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/sendmsg.2.html> (archived, actually for iOS)
* NetBSD: <https://man.netbsd.org/sendmsg.2>
* OpenBSD: <https://man.openbsd.org/sendmsg.2>
* iOS: <https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/sendmsg.2.html> (archived)
* illumos: <https://illumos.org/man/3SOCKET/sendmsg>
* Windows: <https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-sendmsg>
ÁÌúü‰Ì,) [`send_vectored`]: Socket::send_vectoredÁúóœœÈÌú”ÝÌú¬ñÌüÇÌ@üÃÌEüºÌPÄ–Íôõö ôšw õ
æLæLçL£ééLˆ¦ —óë@M$Töª‡{ ¸Í{
¤$¹Í§Ÿ$ÇÍØZ,åÍüëÑ?üÒÎ@= Sends out-of-band (OOB) data on the socket to connected peerÁü—Ï0- by setting the `MSG_OOB` flag for this call.ÁÌÏúüÔÏ?< For more information, see [`send`], [`out_of_band_inline`].Á˜ÐúԠРßü¿Ð6æ‰ú”ÑѤÐÑüÇÑ„òÑ÷ø ÷šw ø±Ùª‡{ ƒÒ{
¥$„Ò¨¤ŠÒüÇÔGüèÒJG Sends data on the socket to the given address. On success, returns theÁä·Ó number of bytes written.ÁØÓúüàÓ?< This is typically used on UDP or datagram-oriented sockets.Áø°Ç#Ÿô¤Ô 
Additional documentation can be found in manual of the OS:
* DragonFly BSD: <https://man.dragonflybsd.org/?command=sendto&section=2>
* FreeBSD: <https://www.freebsd.org/cgi/man.cgi?query=sendto&sektion=2>
* Linux: <https://man7.org/linux/man-pages/man2/sendto.2.html>
* macOS: <https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/sendto.2.html> (archived, actually for iOS)
* NetBSD: <https://man.netbsd.org/sendto.2>
* OpenBSD: <https://man.openbsd.org/sendto.2>
* iOS: <https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/sendto.2.html> (archived)
* illumos: <https://illumos.org/man/3SOCKET/sendto>
* Windows: <https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-sendto>
Á<ÎÔùúû ùšw ú±Ù ûsª‡{ ÖÔ{
¦$×Ô¨¤ÝÔøº$éÔüñÖüÊÕLI Identical to [`send_to`] but allows for specification of arbitrary flagsÁü›Ö$! to the underlying `sendto` call.ÁÄÖúüÌÖ  [`send_to`]: Socket::send_toÁ”øÖüýþ üšw ý±Ù þsª‡{ ”×{
§$•ר¤£×øº$·×ØZ,Ð×ü“ÚZü¼ØHE Send data to a peer listening on `addr`. Returns the amount of bytesÁd‰Ù written.ÁøÈÇ#ŸüšÙ¥äúóœœÌÙú”áÙú¬õÙüËÙ@üÇÙEü¾ÙP„šÚÿ ÿšw 
æLæLçL£ééLˆ¦ —óë@M$T sª‡{ «Ú{
¨$¬Ú§Ÿ$²Úøº$ÈÚü×Ýšü³ÛEB Identical to [`send_to_vectored`] but allows for specification ofÁüýÛA> arbitrary flags to the underlying `sendmsg`/`WSASendTo` call.ÁÃÜúüËÜ2/ [`send_to_vectored`]: Socket::send_to_vectoredÁúóœœÝú”¥Ýú¬¹ÝüÝ@ü‹ÝEü‚ÝPÜÞ݃ ƒšw 
æLæLçL£ééLˆ¦ —óë@M$T sª‡{ ƒÞ{
©$„Þ§Ÿ$’Þøº$°ÞØZ,ÉÞüöàWü¿ß96 Send a message on a socket using a message structure.ÁøàÇ#Ÿüýߥäú󜜯àú”Äàú¬Øàü®à@üªàEü¡àP<ýàˆŠ šw ˆöWŒ¶XKDÑ[6õ\Šª‡{ …á{
ª$†áÏÔŒáØZ,¦áüúâ*|ƒãUÎ{Î{
«´°LüÑè9„ÔèUšwŸƒ
¬Ú4åè\Ñÿü³ý.+ Socket options get/set using `SOL_SOCKET`.ÁâýúüæýEB Additional documentation can be found in documentation of the OS.Áü¬þB? * Linux: <https://man7.org/linux/man-pages/man7/socket.7.html>Áüïþa^ * Windows: <https://docs.microsoft.com/en-us/windows/win32/winsock/sol-socket-socket-options>Ášw®°±²´µ·¹º¼½¿ÀÂÃÄÅÇÈÊËÌü¯+üãÿ?< Get the value of the `SO_BROADCAST` option for this socket.Á§€úü¯€B? For more information about this option, see [`set_broadcast`].Áö€úüþ€,) [`set_broadcast`]: Socket::set_broadcastÁL¶Œ Œšw±ê­ À­
®\Ö‚®“Á¯«Á¯ÈÁ¯¯®¯ü°„>ü‡ƒ?< Set the value of the `SO_BROADCAST` option for this socket.Á˃úüÓƒGD When enabled, this socket is allowed to send packets to a broadcastÁdŸ„ address.Ál·„ šw‰œ­ Å„­
°$Æ„Å"LÌ„üºˆ9üĆ:7 Get the value of the `SO_ERROR` option on this socket.Áƒ‡úü‹‡JG This will retrieve the stored error in the underlying socket, clearingÁüÚ‡LI the field in the process. This can be useful for checking errors betweenÁT«ˆ calls.ÁTÁˆŽ ŽšwÖ¿Ù¿Ú¿«Û¿ˆÜ¿Ý¿Þ¿ˆ‚†f|Â
Û¼ݼÞ¼©ß¼à¼ÛἈcSñŸ«‡zÙ²¿²¿­ ̈­
±$͈ü½Œ+üòŠ>; Get the value of the `SO_KEEPALIVE` option on this socket.Áµ‹úü½‹B? For more information about this option, see [`set_keepalive`].Á„ŒúüŒŒ,) [`set_keepalive`]: Socket::set_keepaliveÁLÄŒ šw±ê­ ÎŒ­
²$ÏŒ²“Á³«Á³ÈÁ³³²³ÈŽüª>ü”Ž;8 Set value for the `SO_KEEPALIVE` option on this socket.ÁÔŽúüÜŽIF Enable sending of keep-alive messages on connection-oriented sockets.Ál± šw‰œ­ ¿­
´‚#LÆüý’4ü¾‘;8 Get the value of the `SO_LINGER` option on this socket.Áþ‘úü†’?< For more information about this option, see [`set_linger`].ÁÊ’úüÒ’&# [`set_linger`]: Socket::set_lingerÁ4„“ šwÖ¿Ù¿Ú¿«Û¿ˆÜ¿Ý¿Þ¿ˆ‚†f|Â
„ž²¿­ ‹“­
µ$Œ“üõ™DüÒ”85 Set value for the `SO_LINGER` option on this socket.Áúü—•HE If `linger` is not `None`, a close(2) or shutdown(2) will not returnÁüä•KH until all queued messages for the socket have been successfully sent orÁü´–DA the linger timeout has been reached. Otherwise, the call returnsÁüý–JG immediately and the closing is done in the background. When the socketÁüÌ—FC is closed as part of exit(2), it always lingers in the background.Á—˜ú\Ÿ˜Øí¯˜úü·˜HE On most OSs the duration only has a precision of seconds and will beÁ¼„™ silently truncated.Á ™úü¨™HE On Apple platforms (e.g. macOS, iOS, etc) this uses `SO_LINGE
oob_inlineÁT§£ü §*ü¡¥:7 Get value for the `SO_PASSCRED` option on this socket.Áà¥úüè¥A> For more information about this option, see [`set_passcred`].Á®¦úü¶¦*' [`set_passcred`]: Socket::set_passcredÁúò œï¦ú«
¤„§üî¦+üå¦6D§§ šw±ê­ °§­
º$±§TŨº“Á»«Á»ÈÁ»»º»ÈŽüâª<üô¨:7 Set value for the `SO_PASSCRED` option on this socket.Á³©úü»©MJ If this option is enabled, enables the receiving of the `SCM_CREDENTIALS`Á¬ª control messages.Áúò œ±ªú«
¤Æªü°ª+ü§ª6déª šw‰œ­ öª­
¼$÷ªŠ$Dýªüµ¯)üò¬:7 Get value for the `SO_PRIORITY` option on this socket.Á±­úü¹­A> For more information about this option, see [`set_priority`].Áÿ­úü‡®*' [`set_priority`]: Socket::set_priorityÁ»£|É®úò œæ®úŒ ¬û®úÊ ¬’¯üå®Cü¿®oü¶®zD¼¯ šwÖ¿Ù¿Ú¿«Û¿ˆÜ¿Ý¿Þ¿ˆ‚†f|Â
²¿­ ů­
½$Ư4Ù°½“Á¾«Á¾ÈÁ¾¾½¾ËŽüƳ;ü‚±:7 Set value for the `SO_PRIORITY` option on this socket.ÁÁ±úüɱ\Y Packets with a higher priority may be processed earlier depending on the selected deviceÁβ queueing discipline.Á»£|Ú²úò œ÷²úŒ ¬Œ³úÊ ¬£³üö²CüвoüDzzdͳ˜ ˜šw‰œ­ Ú³­
¿$Û³³$Dá³ü¯·3üÕµ85 Get value for the `SO_RCVBUF` option on this socket.Á’¶úüš¶IF For more information about this option, see [`set_recv_buffer_size`].Áè¶úüð¶:7 [`set_recv_buffer_size`]: Socket::set_recv_buffer_sizeÁ„¶· šwª‡­ Ç·­
À$È·4Û¸À“ÁÁ«ÁÁÈÁÁÁÀÁËŽü±ºAü†¹85 Set value for the `SO_RCVBUF` option on this socket.Áùúü˹HE Changes the size of the operating system's receive buffer associatedÁ¤˜º with the socket.Á¤¸ºš ššw‰œ­ ͺ­
Â$κ$Ôºüð½:üÀ¼:7 Get value for the `SO_RCVTIMEO` option on this socket.Áÿ¼úü‡½HE If the returned timeout is `None`, then `read` and `recv` calls willÁ¼Ô½ block indefinitely.Ád÷½ šwªœ­ „¾­
Ã$…¾ü¨ÀLüƒ¿:7 Set value for the `SO_RCVTIMEO` option on this socket.Á¿úüÊ¿C@ If `timeout` is `None`, then `read` and `recv` calls will blockÁŒ’À indefinitely.Á„¯Àœ œšw„ž‰œ­ ÀÀ­
Ä$ÁÀ²¢DÇÀü²Ã/üÛÁ>; Get the value of the `SO_REUSEADDR` option on this socket.ÁžÂúü¦ÂFC For more information about this option, see [`set_reuse_address`].ÁñÂúüùÂ41 [`set_reuse_address`]: Socket::set_reuse_addressÁl¹Ã šw±ê­ Çí
Å$ÈÃ<ÝÄÅ“ÁÆ«ÁÆÈÁÆÆÅÆÈŽü¤Ç>ü†Å;8 Set value for the `SO_REUSEADDR` option on this socket.ÁÆÅúüÎÅHE This indicates that further calls to `bind` may allow reuse of localÁü›ÆKH addresses. For IPv4 sockets this means that a socket may bind even whenÁüëÆ41 there's a socket already listening on this port.ÁŒ«Çž žšw‰œ­ ½Ç­
Ç$¾ÇA,ÄÇü‘Ë3ü´É;8 Get the value of the `SO_SNDBUF` option on this socket.ÁôÉúüüÉIF For more information about this option, see [`set_send_buffer_size`].ÁÊÊúüÒÊ:7 [`set_send_buffer_size`]: Socket::set_send_buffer_sizeÁ„˜ËŸ Ÿšwª‡­ ©Ë­
È$ªË4½ÌÈ“ÁÉ«ÁÉÈÁÉÉÈÉ“½üÎAüèÌ85 Set value for the `SO_SNDBUF` option on this socket.Á¥Íúü­ÍJG Changes the size of the operating system's send buffer associated withÁ|üÍ the socket.Á¤—Π  šw‰œ­ ¬Î­
Ê$­Î$³ÎüÐÑ;üŸÐ:7 Get value for the `SO_SNDTIMEO` option on this socket.ÁÞÐúüæÐIF If the returned timeout is `None`, then `write` and `send` cal
¤ˆú
¬Ÿˆú󜜾ˆúÓ
¬Ûˆú¥Œúˆú¹¤•‰úË”³‰ú«
¤Ï‰ú”í‰ú¬‰Šü ‡üœ‡ü“‡œ³Š­®¯ ­šw ®†» ¯­v‰œÏ ЊÏ
Ø$ÑŠýÅLߊ“ÆLýŠüÅ’ŽüÀMöó’ŽúüšŽHE For more information about this option, see [`join_multicast_v4_n`].ÁçŽúüïŽ85 [`join_multicast_v4_n`]: Socket::join_multicast_v4_nÁ
úÜŒÃúú œÞúÞ ¬ûú
¤šú
¬¸úóœœ×úÓ
¬ôú¥Œ“‘ú¹¤®‘ú˔̑ú«
¤è‘ú”†’ú¬¢’ü¹üµü¬¤Ì’°±² °šw ±†» ²­v‰œÏ ê’Ï
Ù$ë’ýÅLù’“ÆL—“üÞœüÛ•XU Join a multicast SSM channel using `IP_ADD_SOURCE_MEMBERSHIP` option on this socket.Á¸–úüÀ–LI This function specifies a new multicast channel for this socket to join.Áü‘—]Z The group must be a valid SSM group address, the source must be the address of the senderÁüó—_\ and `interface` is the address of the local interface with which the system should join theÁüטJÑñü¦™5¦ò ú  ¼÷™úú œ˜šú±”µšú
¤Ñšú
¬ïšú󜜎›úÊ ¬«›ú¥ŒÊ›ú¹¤å›úË”ƒœú”Ÿœú¬»œüí™éüé™îüà™ù\圳´µ ³šw ´†» µ†» †»‰œÏ úœÏ
Ú$ûœsourceÁ4‰groupÁ,¤“Æü륎ü’¡TQ Leave a multicast group using `IP_DROP_SOURCE_MEMBERSHIP` option on this socket.Áë¡úüó¡@= For more information about this option, see [`join_ssm_v4`].Á¸¢úüÀ¢(% [`join_ssm_v4`]: Socket::join_ssm_v4Á ú  ¼„£úú œ¥£ú±”£ú
¤Þ£ú
¬ü£ú󜜛¤úÊ ¬¸¤ú¥Œ×¤ú¹¤ò¤úË¥ú”¬¥ú¬È¥üú¢éüö¢îüí¢ùdò¥·¸¹º ·šw ¸†» ¹†» º†»‰œÏ ˆ¦Ï
Û$‰¦ì…4—¦û…,²¦“ÆL̦ü¼¬2ü¡ªC@ Get the value of the `IP_MULTICAST_ALL` option for this socket.ÁéªúüñªIF For more information about this option, see [`set_multicast_all_v4`].Á¿«úüÇ«:7 [`set_multicast_all_v4`]: Socket::set_multicast_all_v4Á»£|¬úò œ¡¬ü¬&ü†¬1„ì» »šw±êÏ Ô¬Ï
Ü$Õ¬,ï­Ü“ÁÝ«ÁÝÈÁÝÝÜÝÈŽü÷²?ü”®C@ Set the value of the `IP_MULTICAST_ALL` option for this socket.ÁÜ®úüä®<9 This option can be used to modify the delivery policy ofÁü¥¯2/ multicast messages. The argument is a booleanÁüܯ@= (defaults to true). If set to true, the socket will receiveÁü¡°63 messages from all the groups that have been joinedÁüܰ=: globally on the whole system. Otherwise, it will deliverÁüž±;8 messages only from the groups that have been explicitlyÁüÞ±>; joined (for example via the `IP_ADD_MEMBERSHIP` option) onÁÜ¡² this particular socket.Á»£|˲úò œÜ²üʲ&üÁ²1¤þ²¼ ¼šw‰œÏ “³Ï
Þ$”³£š³ü·5ü‹µB? Get the value of the `IP_MULTICAST_IF` option for this socket.ÁÒµúüÚµHE For more information about this option, see [`set_multicast_if_v4`].Á§¶úü¯¶85 [`set_multicast_if_v4`]: Socket::set_multicast_if_v4Áú”ö¶¤õ¶üì¶|—·½ ½šwÖ¿Ù¿Ú¿«Û¿ˆÜ¿Ý¿Þ¿ˆ‚†f|Â
†»²¿Ï §·Ï
ß$¨·ü‹ºIüÒ¸B? Set the value of the `IP_MULTICAST_IF` option for this socket.Á™¹úü¡¹A> Specifies the interface to use for routing multicast packets.Áú”ñ¹¤ð¹ü繜’º¾¿ ¾šw ¿†»‰œÏ ¦ºÏ
à$§º“ÆL­ºüÁ¾3üؼDA Get the value of the `IP_MULTICAST_LOOP` option for this socket.Á¡½úü©½JG For more information about this option, see [`set_multicast_loop_v4`].Áø½úü€¾<9 [`set_multicast_loop_v4`]: Socket::set_multicast_loop_v4ÁŒÈ¾À Àšw±êÏ Ú¾Ï
á$Û¾Lõ¿á“Áâ«ÁâÈÁââáâÈŽü‚ÂDü¢ÀDA Set the value of the `IP_MULTICAST_LOOP` option for this socket.ÁëÀúüóÀJG If enabled, multicast packets will be looped back to the local socket.ÁüÂÁ;8 Note that this may not have any affect on IPv6 sockets.Á¬‰ÂÁ Ášw‰œÏ ŸÂÏ
ã$ Âloop_v4Á<¦Âü„Æ1üŸÄC@ Get the value of the `IP_MULTICAST_TTL` option for this socket.ÁçÄúüïÄIF For more information about this option, see [`set_multicast_ttl_v4`].Á½ÅúüÅÅ:7 [`set_multicast_ttl_v4`]: Socket::set_multicast_ttl_v4Á„‹ÆÂ šw‡µÏ œÆÏ
ä$Æ,µÇä“Áå«ÁåÈÁååäåÕ¶üÑÊ>üÜÇC@ Set the value of the `IP_MULTICAST_TTL` option for this socket.Á¤Èúü¬ÈFC Indicates the time-to-live value of outgoing multicast packets forÁü÷ÈJG this socket. The default value is 1 which means that multicast packetsÁüÆÉ>; don't leave the local network unless explicitly requested.Á‰Êúü‘Ê;¹Ÿ¤ØÊà Úw‰œÏ íÊÏ
æ$îÊttlÁôÊü Î'üãÌ96 Get the value of the `IP_TTL` option for this socket.Á¡Íúü©Í?< For more informatio
¤Óàú
¬ñàúóœœáúÓ
¬­áúú œÌáú¥Œéáú¹¤„âúøœ¢âúË”¿âú«
¤Ûâú”ùâú¬•ãü³ßýü¯ßü¦ß|¿ãÈ Èšw‰œÏ ÏãÏ
í$Ðãrecv_tosÁDÖãü¬ë-üÊå=: Get the value of the `IP_RECVTOS` option for this socket.ÁŒæúü”æDA For more information about this option, see [`set_recv_tos_v4`].ÁÝæúüåæ0- [`set_recv_tos_v4`]: Socket::set_recv_tos_v4ÁúÜŒ±çú  ¼ÌçúÊ ¬íçú±”ŒèúÞ ¬¨èú
¤Çèú
¬åèú󜜄éúÓ
¬¡éúú œÀéú¥ŒÝéú¹¤øéúøœ–êúË”³êú«
¤Ïêú”íêú¬‰ëü§çýü£çüšç\³ëÉ Éšw±êÏ ¿ëÏ
î$ÀëTÓìî“Áï«ÁïÈÁïïîïÈŽü™ï5üíB? Get the value for the `SO_ORIGINAL_DST` option on this socket.Á»£|ÛíúŒ ¬…îúÊ ¬¨îúò œËîúâ¬ìîü÷íüÑíÁüÈíÌ| ïÊ ÊšwíÄÏ °ïÏ
ð$±ï\Æòü†ðPM Socket options for IPv6 sockets, get/set using `IPPROTO_IPV6` or `SOL_IPV6`.Á×ðúüÛðEâ‡ü¡ñ@= * Linux: <https://man7.org/linux/man-pages/man7/ipv6.7.html>Áüâñc` * Windows: <https://docs.microsoft.com/en-us/windows/win32/winsock/ipproto-ipv6-socket-options>Ášwòôõ÷øùúüýÿƒˆŒŽü»÷4üØò<Ð×™óúü¡óKH For more information about this option, see [`set_header_included_v6`].Áñóúüùó>; [`set_header_included_v6`]: Socket::set_header_included_v6Á»£|Ïô úóœœýôú¹¤žõúøœÀõú
¬áõú¶ ¬„öú  ¼§öú
¤Ìöú”îöú¬Ž÷üïô¾üëôÃüÅôïü¼ôú”Â÷Ë Ëšw±êñ Õ÷ñ
ò$Ö÷Tëøò“Áó«ÁóÈÁóóòóÈŽüÒ€Füšù<ùÛÛùúüãùIÍÜü±úK¡ÝüûJG When this flag is enabled, the values set by `IP_OPTIONS` are ignored.ÁÐûúÜØû‚ßüøû>¨ß»£|æý ú󜜔þú¹¤µþúøœ×þú
¬øþú¶ ¬›ÿú  ¼¾ÿú
¤ãÿú”…€ú¬¥€ü†þ¾ü‚þÃüÜýïüÓýú´Ù€Ì Ìšw‰œñ ð€ñ
ô$ñ€ŠâD÷€ü¦†3üíƒB? Get the value of the `IPV6_TRANSPARENT` option on this socket.Á´„úü¼„JG For more information about this option, see [`set_ip_transparent_v6`].Á‹…úü“…<9 [`set_ip_transparent_v6`]: Socket::set_ip_transparent_v6Á»£|Þ…úò œó…úŒ ¬ˆ†üò…,üÝ…BüÔ…MŒ­†Í Íšw±êñ ¿†ñ
õ$À†l܇õ“Áö«ÁöÈÁööõöÈŽü¾Hü‘ˆB? Set the value of the `IPV6_TRANSPARENT` option on this socket.Á؈úüàˆ<ùæü¡‰:Àçüà‰<…èü¡Š=ÌèüãŠ<”éü¤‹=Ûéüæ‹7£êü¢Œ=: hosting the application that employs the IPV6_TRANSPARENTÁüäŒ9«ëü¢:ïëáúüé;Áìü©Ž>‡í»£|öŽúò œ‹úŒ ¬ üŠ,üõŽBüìŽM¬ÅΠΚw‰œñ Ûñ
÷žü¨•Wüå‘MJ Join a multicast group using `IPV6_ADD_MEMBERSHIP` option on this socket.Á·’úü¿’30 Some OSs use `IPV6_JOIN_GROUP` for this option.Á÷’úüÿ’JÕïüΓIªðüœ”JG index of the interface to join/leave (or 0 to indicate any interface).Áú¥Œù”úøœŒ•üø”(üô”-üë”8Œ¯•ÏÐ Ïšw Ðí½‰œñ Á•ñ
ø$•ýÅLÈ•“ÆLÞ•üœXü§™OL Leave a multicast group using `IPV6_DROP_MEMBERSHIP` option on this socket.Áû™úüƒš41 Some OSs use `IPV6_LEAVE_GROUP` for this option.Á¼šúüÄšFC For more information about this option, see [`join_multicast_v6`].Áúü—›41 [`join_multicast_v6`]: Socket::join_multicast_v6Áú¥ŒÞ›úøœñ›üÝ›(üÙ›-üЛ8””œÑÒ Ñšw Òí½‰œñ §œñ
ù$¨œýÅL®œ“ÆLÄœüœ¢2üŽ EB Get the value of the `IPV6_MULTICAST_HOPS` option for this socketÁØ úüà JG For more information about this option, see [`set_multicast_hops_v6`].Á¯¡úü·¡<9 [`set_multicast_hops_v6`]: Socket::set_multicast_hops_v6Áú”‚¢¤¢üø¡Œ£¢Ó Óšw‡µñ µ¢ñ
ú$¶¢4Ó£ú“Áû«ÁûÈÁûûúûÕ¶üѦ@üü£EB Set the value of the `IPV6_MULTICAST_HOPS` option for this socketÁƤúüΤHE Indicates the number of "routers" multicast packets will transit forÁü›¥JÊ¥üê¥>Ÿ¦ú”·¦¤¶¦ü­¦¬Ø¦Ô Ôšw‰œñ î¦ñ
ü$ï¦hopsÁ$õ¦üˆ«2üë¨EB Get the value of the `IPV6_MULTICAST_ALL` option for this socket.Áµ©úü½©IF For more information about this option, see [`set_multicast_all_v6`].Á‹ªúü“ª:7 [`set_multicast_all_v6`]: Socket::set_multicast_all_v6Á»£|ܪúò œíªüÛª&üÒª1«Õ Õšw±êñ  «ñ
ý$¡«,¿¬ý“Áþ«ÁþÈÁþþýþÈŽü˱?üä¬EB Set the value of the `IPV6_MULTICAST_ALL` option for this socket.Á®­úü¶­<¼ü÷­2ƒü®®@Àüó®6‹‘ü®¯=Ì‘üð¯;”’ü°°@= joined (for example via the `IPV6_ADD_MEMBERSHIP` option) onÁÜõ°¢“»£|Ÿ±úò œ°±üž±&ü•±1¤Ò±Ö Öšw‰œñ ç±ñ
ÿ$è±£î±üêµ0üã³DA Get the value of the `IPV6_MULTICAST_IF` option for this socket.Á¬´úü´´HE For more information about this option, see [`set_multicast_if_v6`].Áµúü‰µ85 [`set_multicast_if_v6`]: Socket::set_mu
¤œÕú
¬ºÕúóœœÙÕúÓ
¬öÕúú œ•Öú±”²Öú¹¤ÎÖúøœìÖúË”‰×ú”¥×ú¬Á×ü³Ô©ü¯Ô®ü¦Ô¹të×ß ßšw±êñ ú×ñ
Œ$û×l•ÙŒ“Á«ÁÈÁŒÈŽüßEüÉÙB? Set the value of the `IPV6_RECVTCLASS` option for this socket.ÁÚúü˜ÚKH If enabled, the `IPV6_TCLASS` ancillary message is passed with incomingÁüèÚJG packets. It contains a byte which specifies the traffic class field ofÁ´·Û the packet header.Áú  ¼éÛúÊ ¬ŠÜúÞ ¬©Üú
¤ÈÜú
¬æÜú󜜅ÝúÓ
¬¢Ýúú œÁÝú±”ÞÝú¹¤úÝúøœ˜ÞúË”µÞú”ÑÞú¬íÞüßÛ©üÛÛ®üÒÛ¹”—ßà àšw‰œñ ªßñ
Ž$«ß recv_tclassÁ\±ßüÔç2ü²áDA Get the value of the `IPV6_RECVHOPLIMIT` option for this socket.ÁûáúüƒâIF For more information about this option, see [`set_recv_hoplimit_v6`].ÁÑâúüÙâ:7 [`set_recv_hoplimit_v6`]: Socket::set_recv_hoplimit_v6Á»£|«ãâ<Ùãú  ¼îãúÊ ¬“äúÞ ¬¶äú
¤Ùäú
¬ûäú󜜞åúÓ
¬¿åúú œâåú±”ƒæú¹¤£æúË”Åæú«
¤åæú”‡çú¬§çüËãûüÇãü¡ã¬ü˜ã·„Ûçá ášw±êñ ìçñ
$íç|‰é“Á«ÁÈÁÈŽüðïIüÀéDA Set the value of the `IPV6_RECVHOPLIMIT` option for this socket.Á‰êúü‘êEB The received hop limit is returned as ancillary data by recvmsg()ÁüÛêDA only if the application has enabled the IPV6_RECVHOPLIMIT socketÁ\¤ë option:Á»£|Çëâ<õëú  ¼ŠìúÊ ¬¯ìúÞ ¬Òìú
¤õìú
¬—íú󜜺íúÓ
¬Ûíúú œþíú±”Ÿîú¹¤¿îúË”áîú«
¤ïú”£ïú¬Ãïüçëûüãëü½ë¬ü´ë·¤÷ïâ âšw‰œñ Œðñ
$ð
recv_hoplimitÁl“ðüåó5üšòGD Get the value for the `IP6T_SO_ORIGINAL_DST` option on this socket.Á»£|ùòúŒ ¬–óúò œ­óúâ¬Âóü•óCüïòoüæòz|ìóã ãšwíÄñ üóñ
$ýó\€÷üÒô@= Socket options for TCP sockets, get/set using `IPPROTO_TCP`.Á“õúü—õEâ‡üÝõ?< * Linux: <https://man7.org/linux/man-pages/man7/tcp.7.html>Áüöb_ * Windows: <https://docs.microsoft.com/en-us/windows/win32/winsock/ipproto-tcp-socket-options>Ášw”šœü®ú8ü’÷>; Get the value of the `TCP_KEEPIDLE` option on this socket.ÁÕ÷úüÝ÷^[ This returns the value of `TCP_KEEPALIVE` on macOS and iOS and `TCP_KEEPIDLE` on all otherÁüÀø%" supported Unix operating systems.Á»£|ýøâ<«ùúú œÀùú
¬áùúË”„úüùƒü™ùˆüóø´üêø¿”µúä äšwÖ¿Ù¿Ú¿«Û¿ˆÜ¿Ý¿Þ¿ˆ‚†f|Â
Ó›²¿ Èú
$Éúüƒ‚<ü£û?< Get the value of the `TCP_KEEPINTVL` option on this socket.ÁçûúüïûFC For more information about this option, see [`set_tcp_keepalive`].ÁºüúüÂü41 [`set_tcp_keepalive`]: Socket::set_tcp_keepaliveÁ»£|ŽýúŒ ¬¸ýú  ¼Ûýú÷Ä€þú¶ ¬¦þúÊ ¬ÉþúÞ ¬ìþúå Œÿúô ´®ÿúò œÒÿúˆ œóÿú
¤”€ú ”¶€ú© ¬Ö€ú«
¤ù€úøœ›ú”ÀîŒØœ×ü¿,üªýÌü„ýøüûüƒ´Š‚å åšw¿Ÿ ¡‚
$¢‚4½ƒ“Á«ÁÈÁËŽÓ›üüŠ6üûƒ=: Get the value of the `TCP_KEEPCNT` option on this socket.Á½„úüÅ„F  úü˜…4þ »£|ä…úŒ ¬Ž†ú  ¼±†ú÷ÄÖ†ú¶ ¬ü†úÊ ¬Ÿ‡úÞ ¬Â‡úå Œå‡úô ´„ˆúò œ¨ˆúˆ œÉˆú
¤êˆú ”Œ‰ú© ¬¬‰ú«
¤Ï‰úâ¬ñ‰úøœ”Šú”¹ŠîŒÑŠœÐŠü¸Š,ü€†ïüÚ…üÑ…¦¬ƒ‹æ æšw‡µ ™‹
$š‹L®Œ“Á˜«Á˜ÈÁ˜˜˜Õ¶üˆ™HüÝŒDA Set parameters configuring TCP keepalive probes for this socket.Á¦úü®DA The supported parameters depend on the operating system, and areÁü÷KH configured using the [`TcpKeepalive`] struct. At a minimum, all systemsÁüÇŽIF support configuring the [keepalive time]: the time after which the OSÁü•@= will start sending keepalive messages on an idle connection.ÁÚúüâ-* [keepalive time]: TcpKeepalive::with_timeÁúØí¬úü´JG * This will enable `SO_KEEPALIVE` on this socket, if it is not alreadyÁtƒ‘ enabled.Áü–‘HE * On some platforms, such as Windows, any keepalive parameters *not*Áüã‘LI configured by the `TcpKeepalive` struct passed to this function may beÁü´’LI overwritten with their default values. Therefore, this function shouldÁü…“JG either only be called once per socket, or the same parameters shouldÁüÔ“(% be passed every time it is called.Áút‰”šõœ”ú<¤”Öúä°” use std::time::Duration;ÁÑ”úüÙ”63 use socket2::{Socket, TcpKeepalive, Domain, Type};Á”•úüœ•(ÔõüÉ•@Ì«üŽ–'$ let keepalive = TcpKeepalive::new()Áüº–+( .with_time(Duration::from_secs(4));Áüê–KH // Depending on the target operating system, we may also be able toÁüº—FC // configure the keepalive probe interval and/or the number ofÁü…˜  // retries here as well.Áª˜úü²˜*' socket.set_tcp_keepalive(&keepalive)?;Átᘿú<ô˜Öú€™úŒçè çšw è鄉œ ¡™
$¢™paramsÁ4¨™ü‡œ-ü·š=: Get the value of the `TCP_NODELAY` option on this socket.ÁùšúüDA For more information about this option, see [`set_tcp_nodelay`].ÁÊ›úüÒ›0- [`set_tcp_nodelay`]: Socket::set_tcp_nodelayÁ\Žœé éšw±ê šœ
š$›œš“Á«ÁÈÁšÈŽüó >üÜ=: Set the value of the `TCP_NODELAY` option on this socket.Ážžúü¦žEB If set, this option disables the Nagle algorithm. This means thatÁüðžIF segments are always sent as soon as possible, even if there is only aÁü¾ŸIF small amount of data. When not set, data is buffered until there is aÁüŒ KH sufficient amount to send out, thereby avoiding the frequent sending ofÁ”Ü  small packets.Á|ú ê êšw‰œ Š¡
œ$‹¡nodelayÁ<‘¡¤ý¥šwžŸá â žŸü˜¦7$›¦ëì ëšw ì±Ùª‡  ¦
ž$¥¦¨¤«¦ü¦©Múóœœß¨ú”ô¨ú¬ˆ©üÞ¨@üÚ¨EüѨPl©©íîï íšw î
ö ö ÷ ‡àù ˆ¦ èóÇãp9Ü慎 ·©
Ÿ$¼©§Ÿ$©D°­Ÿ“Á «Á ÈÁ  Ÿ úŸäÅ­Ì2¢¢Ëw£¤á â £¤Ê­üè­7$ë­ðñ ðËw ñ±Ùª‡¡ ð­¡
£Ì2$õ­¨¤û­üš°MúóœœÓ¯ú”è¯ú¬ü¯üÒ¯@üίEüůPl°òóô òËw ó
ö ö ÷ ‡àù ˆ¦ èóÇãp9Üôª‡¡ «°¡
¤Ì2$°°§Ÿ$¶°D£²¤“Á¥«Á¥ÈÁ¥¥¤¥øÃ¬¸²šw§¨© !¡!¤!¨©§üÔ²4,ײõö õšw ö±Ùª‡¦ ݲ¦
§$Ⲩ¤è²ü‚´Gú󜜻³ú”гú¬ä³üº³@ü¶³Eü­³Pt…´÷øù ÷šw ø
æLæLçL£ééLˆ¦ —óë@M$Tùª‡¦ ”´¦
¨$™´§Ÿ$Ÿ´üø´%,û´ú úšw‰œ¦ µ¦
©$†µ층Ì2««Ëw¬­® !¡!¤!¬­®½µüܵ4,ßµûü ûËw ü±Ùª‡ª 嵪
¬Ì2$굨¤ðµüŠ·GúóœœÃ¶ú”ضú¬ì¶ü¶@ü¾¶Eüµ¶Pt·ýþÿ ýËw þ
æLæLçL£ééLˆ¦ —óë@M$Tÿª‡ª œ·ª
­Ì2$¡·§Ÿ$§·ü€¸%,ƒ¸ € Ëw‰œª ‰¸ª
®Ì2$ޏÔÀ¸šw°Àc°üá¸8ä¸  ƒ   šw   c cˆ¢cµ
 `£c¨¤ `àB¤GS
ƒ Ï¥¯ 踯
°$鸱 ï¸\ƒ5<‡5»× ¤,±²½é\±³½é±³ ManuallyDropÁd:ÃÛ±´r,Vé!±µAsFdÁ$²,±·AsRawFdÁ<¸«+±¸”á­+±¹óy±ºËDÖÄÆ´0•|L†\¤tv\^JLl¤=´Öü´PM A reference to a [`Socket`] that can be used to configure socket types otherÁü…" than the `Socket` type itself.Á¨úü¬NK This allows for example a [`TcpStream`], found in the standard library, toÁüûOL be configured using all the additional methods found in the [`Socket`] API.ÁËúüÏJG `SockRef` can be created from any socket type that implements [`AsFd`]ÁüšGD (Unix) or [`AsSocket`] (Windows) using the [`From`] implementation.Áâúüæ&íìüÖHE [`AsFd`]: https://doc.rust-lang.org/stable/std/os/fd/trait.AsFd.htmlÁüŸXU [`AsSocket`]: https://doc.rust-lang.org/stable/std/os/windows/io/trait.AsSocket.htmlÁøúšõúüIF Below is an example of converting a [`TcpStream`] into a [`SockRef`].ÁÙúÖúüå*' use std::net::{TcpStream, SocketAddr};Á úÌ”  use socket2::SockRef;Á® úü² ;8 # fn main() -> Result<(), Box<dyn std::error::Error>> {Áüî 41 // Create `TcpStream` from the standard library.Áü£
85 let address: SocketAddr = "127.0.0.1:1234".parse()?;矆
?< # let b1 = std::sync::Arc::new(std::sync::Barrier::new(2));ÁÔœ  # let b2 = b1.clone();Áü· /, # let handle = std::thread::spawn(move || {Áüç FC # let listener = std::net::TcpListener::bind(address).unwrap();Áœ®  # b2.wait();Áü 63 # let (stream, _) = listener.accept().unwrap();Áüù B? # std::thread::sleep(std::time::Duration::from_millis(10));Á´¼
 # drop(stream);Á
 # });Á„Ý

# b1.wait();Áüî
.+ let stream = TcpStream::connect(address)?;Áúü¡.+ // Create a `SockRef`erence to the stream.ÁüÐ,) let socket_ref = SockRef::from(&stream);Áüý30 // Use `Socket::set_tcp_nodelay` on the stream.Áü±&# socket_ref.set_tcp_nodelay(true)?;Á¬Ø drop(socket_ref);Áîúüò(% assert_eq!(stream.nodelay()?, true);Áì› # handle.join().unwrap();Á¤²¢Öú™4¼¼òyÇSZä ·‹ˆ½¾é䫱»»ÃÛÃÛÈÑÅÛ»¬µÜÀ,%*šwüê"±»»½éFu\»Ÿ ™4šwô‘™4ÀÀòyÁÂê!ë!¿¿šwüÑ  „ òy òyê!¿ Ú¿
™4ü£:ü’MJ On Windows, a corresponding `From<&impl AsSocket>` implementation exists.Áúú”ôœ‹üó,üé7üàB™4ĤÅÄÅÍìÂz ¬,ÂzòyÆëƨ')ôüä41 The caller must ensure `S` is actually a socket.Á$ ¼zòyÃÃ
Æ™4ÂzÚü·8ÐzÈÀcÈüÝ8àˆ  † Ðz  c cˆ¢cµ
 `£c¨¤ `àB¤GS
ˆ 촂 äÇ
È8± ë<§6«6ÌÏÐÑàíîðñòóôõˆŠŒœŸ ¡¢¤¦©«¬®°²³µ¸¹º»¼¾¿ÀÁÃÅÈËÌÍÎÏÐÓ®×minÁï ÅÉÊOsStrÁ,¢ˆÉË£é<‡æLÉ̽éÉͽéÉÍíëÉÏš ÀÉЂêÑÛÉÑùà¶MÉÒ’ºD¾ºÉÔù¼D‹̺ÉÕ
NonZeroU32ÁTäÉÖ NonZeroUsizeÁdº