425件ヒット
[1-100件を表示]
(0.042秒)
クラス
- Addrinfo (66)
- BasicSocket (99)
-
Socket
:: AncillaryData (77) -
Socket
:: Ifaddr (29) -
Socket
:: Option (88) - TCPServer (11)
- UDPSocket (33)
- UNIXServer (11)
- UNIXSocket (11)
キーワード
- afamily (11)
- bool (11)
- data (11)
- family (22)
- flags (11)
- getpeereid (11)
- getsockopt (11)
- ifindex (11)
-
ip
_ pktinfo (11) -
ip
_ port (11) -
ip
_ unpack (11) -
ipv6
_ pktinfo (11) -
ipv6
_ pktinfo _ ifindex (11) - level (22)
- linger (11)
- optname (11)
- pfamily (11)
- protocol (11)
-
recv
_ io (11) - recvmsg (11)
-
recvmsg
_ nonblock (11) - send (44)
- sendmsg (11)
-
sendmsg
_ nonblock (11) - setsockopt (22)
- socktype (11)
- sysaccept (22)
-
to
_ s (11) - type (11)
- vhid (7)
検索結果
先頭5件
-
Socket
:: AncillaryData # int -> Integer (18228.0) -
自身が保持している cmsg data (データ) を整数の形で返します。
...異なります。
require 'socket'
ancdata = Socket::AncillaryData.int(:UNIX, :SOCKET, :RIGHTS, STDERR.fileno)
p ancdata.int #=> 2
@raise TypeError cmgs data のサイズが int のバイト数と異なる場合に発生します
@see Socket::AncillaryData.new Socket::AncillaryData.int... -
Socket
:: Option # int -> Integer (18210.0) -
オプションのデータ(内容)を整数に変換して返します。
...オプションのデータ(内容)を整数に変換して返します。
@raise TypeError dataのバイト数が不適切である(sizeof(int)と異なる)場合に発生します
@see Socket::Option#data... -
BasicSocket
# getpeereid -> [Integer , Integer] (203.0) -
Unix ドメインソケットにおいて接続相手の euid と egid を 返します。
..., 2番目の要素が egid です。
ソケットが Unix ドメインソケットでない場合の返り値は
不定です。
require 'socket'
Socket.unix_server_loop("/tmp/sock") {|s|
begin
euid, egid = s.getpeereid
# Check the connected client is myself or not.... -
BasicSocket
# sendmsg(mesg , flags=0 , dest _ sockaddr=nil , *controls) -> Integer (109.0) -
sendmsg(2) を用いてメッセージを送ります。
...ンブロッキング方式で通信したい
場合は BasicSocket#sendmsg_nonblock を用います。
ソケットが connection-less の場合は dest_sockaddr で
通信先のアドレスを指定しなければなりません。Socket.sockaddr_in
の返り値や Addrinfo オブジェクトを......ます。
Socket::AncillaryData のインスタンスや
3要素(cmsg_level, cmsg_type, cmsg_data) の配列を用いることができます。
送ったバイト数を返します。
# UnixSocket#send_io の実装例
# use Socket::AncillaryData.
require 'socket'
ancdata = Socket::Ancill......aryData.int(:UNIX, :SOCKET, :RIGHTS, io.fileno)
sock.sendmsg("a", 0, nil, ancdata)
# use 3-element array.
ancdata = [:SOCKET, :RIGHTS, [io.fileno].pack("i!")]
sock.sendmsg("\0", 0, nil, ancdata)
@param mesg メッセージ文字列
@param flags フラグ(Socket::MSG_* という定数の... -
Addrinfo
# afamily -> Integer (103.0) -
アドレスファミリーを整数で返します。
...アドレスファミリーを整数で返します。
require 'socket'
Addrinfo.tcp("localhost", 80).afamily == Socket::AF_INET #=> true... -
Addrinfo
# ip _ port -> Integer (103.0) -
ポート番号を整数で返します。
...ポート番号を整数で返します。
require 'socket'
Addrinfo.tcp("127.0.0.1", 80).ip_port #=> 80
Addrinfo.tcp("::1", 80).ip_port #=> 80
@see Addrinfo#ip_address, Addrinfo#ip_unpack... -
Addrinfo
# ip _ unpack -> [String , Integer] (103.0) -
IP アドレスとポート番号を 2 要素の配列で返します。
...IP アドレスとポート番号を 2 要素の配列で返します。
require 'socket'
Addrinfo.tcp("127.0.0.1", 80).ip_unpack #=> ["127.0.0.1", 80]
Addrinfo.tcp("::1", 80).ip_unpack #=> ["::1", 80]
@see Addrinfo#ip_address, Addrinfo#ip_port... -
Addrinfo
# pfamily -> Integer (103.0) -
プロトコルファミリーを整数で返します。
...プロトコルファミリーを整数で返します。
require 'socket'
Addrinfo.tcp("localhost", 80).pfamily == Socket::PF_INET #=> true... -
Addrinfo
# protocol -> Integer (103.0) -
ソケットプロトコルを整数で返します。
...ソケットプロトコルを整数で返します。
require 'socket'
Addrinfo.tcp("localhost", 80).protocol == Socket::IPPROTO_TCP #=> true... -
Addrinfo
# socktype -> Integer (103.0) -
ソケットタイプを整数で返します。
...ソケットタイプを整数で返します。
require 'socket'
Addrinfo.tcp("localhost", 80).socktype == Socket::SOCK_STREAM #=> true...