描述
此函數將套接字選項 OPTNAME 設置為指定 LEVEL 上 SOCKET 上的 OPTVAL 值。您將需要導入 Socket 模塊以獲得下表中顯示的 OPTNAME 的有效值
用法
以下是此函數的簡單語法 âˆ'
setsockopt SOCKET, LEVEL, OPTNAME, OPTVAL
返回值
此函數在失敗時返回 undef,成功時返回 1。
OPTNAME Description SO_DEBUG Enable/disable recording of debugging information. SO_REUSEADDR Enable/disable local address reuse. SO_KEEPALIVE Enable/disable keep connections alive. SO_DONTROUTE Enable/disable routing bypass for outgoing messages. SO_LINGER Linger on close if data is present. SO_BROADCAST Enable/disable permission to transmit broadcast messages. SO_OOBINLINE Enable/disable reception of out-of-band data in band. SO_SNDBUF Set buffer size for output. SO_RCVBUF Set buffer size for input. SO_TYPE Get the type of the socket (get only). SO_ERROR Get and clear error on the socket (get only).
相關用法
- Perl setservent用法及代碼示例
- Perl setpriority用法及代碼示例
- Perl setpwent用法及代碼示例
- Perl sethostent用法及代碼示例
- Perl setgrent用法及代碼示例
- Perl setprotoent用法及代碼示例
- Perl setnetent用法及代碼示例
- Perl semget用法及代碼示例
- Perl send用法及代碼示例
- Perl seekdir用法及代碼示例
- Perl semctl用法及代碼示例
- Perl semop用法及代碼示例
- Perl select用法及代碼示例
- Perl sin()用法及代碼示例
- Perl split用法及代碼示例
- Perl shmctl用法及代碼示例
- Perl splice用法及代碼示例
注:本文由純淨天空篩選整理自 Perl setsockopt Function。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。