種類
- 定数 (34)
- インスタンスメソッド (6)
- 特異メソッド (6)
クラス
- BasicSocket (3)
- IPSocket (1)
- Socket (21)
- UDPSocket (2)
- UNIXSocket (2)
モジュール
-
Socket
:: Constants (17)
キーワード
-
AF
_ DATAKIT (2) -
AF
_ DEC (2) -
AF
_ DLI (2) -
AF
_ ISDN (2) -
AF
_ NDRV (2) -
IFF
_ OVS _ DATAPATH (2) -
IPPROTO
_ DSTOPTS (2) -
IPPROTO
_ IDP (2) -
IPPROTO
_ ND (2) -
IPPROTO
_ UDP (2) -
PF
_ DATAKIT (2) -
PF
_ DEC (2) -
PF
_ DLI (2) -
PF
_ ISDN (2) -
PF
_ NDRV (2) -
SOCK
_ DGRAM (2) -
SOCK
_ RDM (2) - addr (1)
-
do
_ not _ reverse _ lookup (1) -
local
_ address (1) - new (2)
- pair (1)
- peeraddr (2)
-
remote
_ address (1) - socketpair (1)
検索結果
先頭5件
-
UDPSocket
. open(address _ family=Socket :: AF _ INET) -> UDPSocket (54610.0) -
新しい UDP ソケットを返します。
...ss_family には Socket::AF_INET のような整数、:INET のような
シンボル、"INET" のような文字列を指定することができます。
require 'socket'
UDPSocket.new # => #<UDPSocket:fd 3>
UDPSocket.new(Socket::AF_INET6) # => #<UDPSocket:fd 4>
@param a... -
Socket
. open(domain , type , protocol=0) -> Socket (45610.0) -
新しいソケットを生成します。domain、type、 protocol はインクルードファイルにある定数で指定しま す。ほとんどの定数は Socket::AF_INET のように Socket クラスの定数として定義されています。domain とtype に関しては、"AF_INET", "SOCK_STREAM" のように文字列でも指定できますが、文 字列ですべての機能を指定できる保証はありません。
...します。domain、type、
protocol はインクルードファイルにある定数で指定しま
す。ほとんどの定数は Socket::AF_INET のように
Socket クラスの定数として定義されています。domain
とtype に関しては、"AF_INET",
"SOCK_STREAM" のように文字......りません。
例えば、IPv4 の TCP ソケットは以下のように生成されます。
require 'socket'
s = Socket.new(Socket::AF_INET, Socket::SOCK_STREAM, 0)
なお、socket(2) の domain 引数において AF_ と PF_ のどちらの定数を使用するかについては混乱......ここでは AF_ を使用しています。
@param domain 例えば、<sys/socket.h> のようなインクルードファイルに定義されている定数を指定します。
@param type 例えば、<sys/socket.h> のようなインクルードファイルに定義されている定数を... -
BasicSocket
# local _ address -> Addrinfo (18643.0) -
getsockname(2) で得られたローカルアドレス情報を Addrinfo オブジェクトとして返します。
...してください。
require 'socket'
TCPSocket.open("www.ruby-lang.org", 80) {|s|
p s.local_address #=> #<Addrinfo: 192.168.0.129:36873 TCP>
}
TCPServer.open("127.0.0.1", 1512) {|serv|
p serv.local_address #=> #<Addrinfo: 127.0.0.1:1512 TCP>
}
@see BasicSocket#getsockname... -
BasicSocket
# remote _ address -> Addrinfo (18643.0) -
getpeername(2) で得られたリモートアドレス情報を Addrinfo オブジェクトとして返します。
...返すことに注意してください。
require 'socket'
TCPSocket.open("www.ruby-lang.org", 80) {|s|
p s.remote_address #=> #<Addrinfo: 221.186.184.68:80 TCP>
}
TCPServer.open("127.0.0.1", 1728) {|serv|
c = TCPSocket.new("127.0.0.1", 1728)
s = serv.accept
p s.remote......_address #=> #<Addrinfo: 127.0.0.1:36504 TCP>
}
@see BasicSocket#getpeername... -
Socket
:: Constants :: SOCK _ DGRAM -> Integer (18373.0) -
データグラム通信。 Socket.open の第二引数 type に使用します。
...データグラム通信。
Socket.open の第二引数 type に使用します。
@see socket(2), Socket.open... -
Socket
:: Constants :: SOCK _ RDM -> Integer (18373.0) -
信頼性のあるデータグラム通信。 Socket.open の第二引数 type に使用します。
...信頼性のあるデータグラム通信。
Socket.open の第二引数 type に使用します。
@see socket(2linux), Socket.open... -
Socket
:: SOCK _ DGRAM -> Integer (18373.0) -
データグラム通信。 Socket.open の第二引数 type に使用します。
...データグラム通信。
Socket.open の第二引数 type に使用します。
@see socket(2), Socket.open... -
Socket
:: SOCK _ RDM -> Integer (18373.0) -
信頼性のあるデータグラム通信。 Socket.open の第二引数 type に使用します。
...信頼性のあるデータグラム通信。
Socket.open の第二引数 type に使用します。
@see socket(2linux), Socket.open... -
UNIXSocket
# addr -> [String , String] (18361.0) -
ソケットの接続情報を表す配列を返します。配列の各要素は第1要 素が文字列 "AF_UNIX"、第2要素がパスを表す文字列です。
...す。
例:
require 'socket'
UNIXServer.open("/tmp/s") {|serv|
p serv.addr #=> ["AF_UNIX", "/tmp/s"]
}
UNIXServer.open("/tmp/s") {|serv|
c = UNIXSocket.open("/tmp/s")
p c.peeraddr #=> ["AF_UNIX", "/tmp/s"]
p c.addr #=> ["AF_UNIX", ""]
}
@see UNIXSocket#peeraddr... -
Socket
:: AF _ DATAKIT -> Integer (18355.0) -
@todo datakit protocol。 Socket.open の第一引数 domain に使用します。
...@todo
datakit protocol。
Socket.open の第一引数 domain に使用します。... -
Socket
:: AF _ DEC -> Integer (18355.0) -
@todo DECnet protocol。 Socket.open の第一引数 domain に使用します。
...@todo
DECnet protocol。
Socket.open の第一引数 domain に使用します。... -
Socket
:: AF _ DLI -> Integer (18355.0) -
@todo DEC Direct data link interface。 Socket.open の第一引数 domain に使用します。
...@todo
DEC Direct data link interface。
Socket.open の第一引数 domain に使用します。... -
Socket
:: AF _ ISDN -> Integer (18355.0) -
@todo Integrated Services Digital Network。 Socket.open の第一引数 domain に使用します。
...@todo
Integrated Services Digital Network。
Socket.open の第一引数 domain に使用します。... -
Socket
:: AF _ NDRV -> Integer (18355.0) -
@todo Network driver raw access。 Socket.open の第一引数 domain に使用します。
...@todo
Network driver raw access。
Socket.open の第一引数 domain に使用します。... -
Socket
:: Constants :: AF _ DATAKIT -> Integer (18355.0) -
@todo datakit protocol。 Socket.open の第一引数 domain に使用します。
...@todo
datakit protocol。
Socket.open の第一引数 domain に使用します。... -
Socket
:: Constants :: AF _ DEC -> Integer (18355.0) -
@todo DECnet protocol。 Socket.open の第一引数 domain に使用します。
...@todo
DECnet protocol。
Socket.open の第一引数 domain に使用します。... -
Socket
:: Constants :: AF _ DLI -> Integer (18355.0) -
@todo DEC Direct data link interface。 Socket.open の第一引数 domain に使用します。
...@todo
DEC Direct data link interface。
Socket.open の第一引数 domain に使用します。... -
Socket
:: Constants :: AF _ ISDN -> Integer (18355.0) -
@todo Integrated Services Digital Network。 Socket.open の第一引数 domain に使用します。
...@todo
Integrated Services Digital Network。
Socket.open の第一引数 domain に使用します。... -
Socket
:: Constants :: AF _ NDRV -> Integer (18355.0) -
@todo Network driver raw access。 Socket.open の第一引数 domain に使用します。
...@todo
Network driver raw access。
Socket.open の第一引数 domain に使用します。... -
Socket
:: Constants :: IFF _ OVS _ DATAPATH (18355.0) -
device used as Open vSwitch datapath port
device used as Open vSwitch datapath port -
Socket
:: Constants :: PF _ DATAKIT -> Integer (18355.0) -
@todo datakit protocol。 Socket.open の第一引数 domain に使用します。
...@todo
datakit protocol。
Socket.open の第一引数 domain に使用します。... -
Socket
:: Constants :: PF _ DEC -> Integer (18355.0) -
@todo DECnet protocol。 Socket.open の第一引数 domain に使用します。
...@todo
DECnet protocol。
Socket.open の第一引数 domain に使用します。... -
Socket
:: Constants :: PF _ DLI -> Integer (18355.0) -
@todo DEC Direct data link interface。 Socket.open の第一引数 domain に使用します。
...@todo
DEC Direct data link interface。
Socket.open の第一引数 domain に使用します。... -
Socket
:: Constants :: PF _ ISDN -> Integer (18355.0) -
@todo Integrated Services Digital Network。 Socket.open の第一引数 domain に使用します。
...@todo
Integrated Services Digital Network。
Socket.open の第一引数 domain に使用します。... -
Socket
:: Constants :: PF _ NDRV -> Integer (18355.0) -
@todo Network driver raw access。 Socket.open の第一引数 domain に使用します。
...@todo
Network driver raw access。
Socket.open の第一引数 domain に使用します。... -
Socket
:: IFF _ OVS _ DATAPATH (18355.0) -
device used as Open vSwitch datapath port
device used as Open vSwitch datapath port -
Socket
:: PF _ DATAKIT -> Integer (18355.0) -
@todo datakit protocol。 Socket.open の第一引数 domain に使用します。
...@todo
datakit protocol。
Socket.open の第一引数 domain に使用します。... -
Socket
:: PF _ DEC -> Integer (18355.0) -
@todo DECnet protocol。 Socket.open の第一引数 domain に使用します。
...@todo
DECnet protocol。
Socket.open の第一引数 domain に使用します。... -
Socket
:: PF _ DLI -> Integer (18355.0) -
@todo DEC Direct data link interface。 Socket.open の第一引数 domain に使用します。
...@todo
DEC Direct data link interface。
Socket.open の第一引数 domain に使用します。... -
Socket
:: PF _ ISDN -> Integer (18355.0) -
@todo Integrated Services Digital Network。 Socket.open の第一引数 domain に使用します。
...@todo
Integrated Services Digital Network。
Socket.open の第一引数 domain に使用します。... -
Socket
:: PF _ NDRV -> Integer (18355.0) -
@todo Network driver raw access。 Socket.open の第一引数 domain に使用します。
...@todo
Network driver raw access。
Socket.open の第一引数 domain に使用します。... -
BasicSocket
# do _ not _ reverse _ lookup -> bool (18343.0) -
ソケットごとのアドレスからホスト名への逆引きの設定を返します。
...きの
BasicSocket.do_not_reverse_lookup の値になります。
require 'socket'
BasicSocket.do_not_reverse_lookup = false
TCPSocket.open("www.ruby-lang.org", 80) {|sock|
p sock.do_not_reverse_lookup # => false
}
BasicSocket.do_not_reverse_lookup = true
TCPSocket.open("www.r......uby-lang.org", 80) {|sock|
p sock.do_not_reverse_lookup # => true
}
@see BasicSocket#do_not_reverse_lookup=... -
UNIXSocket
# peeraddr -> [String , String] (18343.0) -
接続相手先ソケットの情報を表す配列を返します。配列の各要素は第1要 素が文字列 "AF_UNIX"、第2要素がパスを表す文字列です。
...各要素は第1要
素が文字列 "AF_UNIX"、第2要素がパスを表す文字列です。
例:
require 'socket'
UNIXServer.open("/tmp/s") {|serv|
c = UNIXSocket.open("/tmp/s")
p c.peeraddr #=> ["AF_UNIX", "/tmp/s"]
p c.addr #=> ["AF_UNIX", ""]
}
@see UNIXSocket#addr... -
IPSocket
# peeraddr -> Array (18325.0) -
接続相手先ソケットの情報を表す配列を返します。配列の各要素は IPSocket#addr メソッドが返す配列 と同じです。
...表す配列を返します。配列の各要素は
IPSocket#addr メソッドが返す配列
と同じです。
@raise Errno::EXXX getpeername(2) が 0 未満の値を返した場合に発生します。
例:
require 'socket'
TCPSocket.open("localhost", "http") {|s|
p s.peeraddr #=>... -
Socket
:: Constants :: IPPROTO _ DSTOPTS -> Integer (18325.0) -
IPv6 destination option。 BasicSocket#getsockopt, BasicSocket#setsockopt の level 引数に使用します。
...IPv6 destination option。
BasicSocket#getsockopt, BasicSocket#setsockopt の
level 引数に使用します。
また、Socket.open の protocol 引数に渡す利用法もあります。
@see 2292... -
Socket
:: Constants :: IPPROTO _ IDP -> Integer (18325.0) -
@todo XNS IDP。 BasicSocket#getsockopt, BasicSocket#setsockopt の level 引数に使用します。
...@todo
XNS IDP。
BasicSocket#getsockopt, BasicSocket#setsockopt の
level 引数に使用します。
また、Socket.open の protocol 引数に渡す利用法もあります。... -
Socket
:: Constants :: IPPROTO _ ND -> Integer (18325.0) -
@todo Sun net disk protocol BasicSocket#getsockopt, BasicSocket#setsockopt の level 引数に使用します。
...@todo
Sun net disk protocol
BasicSocket#getsockopt, BasicSocket#setsockopt の
level 引数に使用します。
また、Socket.open の protocol 引数に渡す利用法もあります。... -
Socket
:: Constants :: IPPROTO _ UDP -> Integer (18325.0) -
User Datagram Protocol。 BasicSocket#getsockopt, BasicSocket#setsockopt の level 引数に使用します。
...User Datagram Protocol。
BasicSocket#getsockopt, BasicSocket#setsockopt の
level 引数に使用します。
また、Socket.open の protocol 引数に渡す利用法もあります。
@see netinet/in.h(header)
udp(4freebsd), udp(7linux)... -
Socket
:: IPPROTO _ DSTOPTS -> Integer (18325.0) -
IPv6 destination option。 BasicSocket#getsockopt, BasicSocket#setsockopt の level 引数に使用します。
...IPv6 destination option。
BasicSocket#getsockopt, BasicSocket#setsockopt の
level 引数に使用します。
また、Socket.open の protocol 引数に渡す利用法もあります。
@see 2292... -
Socket
:: IPPROTO _ IDP -> Integer (18325.0) -
@todo XNS IDP。 BasicSocket#getsockopt, BasicSocket#setsockopt の level 引数に使用します。
...@todo
XNS IDP。
BasicSocket#getsockopt, BasicSocket#setsockopt の
level 引数に使用します。
また、Socket.open の protocol 引数に渡す利用法もあります。... -
Socket
:: IPPROTO _ ND -> Integer (18325.0) -
@todo Sun net disk protocol BasicSocket#getsockopt, BasicSocket#setsockopt の level 引数に使用します。
...@todo
Sun net disk protocol
BasicSocket#getsockopt, BasicSocket#setsockopt の
level 引数に使用します。
また、Socket.open の protocol 引数に渡す利用法もあります。... -
Socket
:: IPPROTO _ UDP -> Integer (18325.0) -
User Datagram Protocol。 BasicSocket#getsockopt, BasicSocket#setsockopt の level 引数に使用します。
...User Datagram Protocol。
BasicSocket#getsockopt, BasicSocket#setsockopt の
level 引数に使用します。
また、Socket.open の protocol 引数に渡す利用法もあります。
@see netinet/in.h(header)
udp(4freebsd), udp(7linux)... -
UDPSocket
. new(address _ family=Socket :: AF _ INET) -> UDPSocket (9310.0) -
新しい UDP ソケットを返します。
...ss_family には Socket::AF_INET のような整数、:INET のような
シンボル、"INET" のような文字列を指定することができます。
require 'socket'
UDPSocket.new # => #<UDPSocket:fd 3>
UDPSocket.new(Socket::AF_INET6) # => #<UDPSocket:fd 4>
@param a... -
Socket
. pair(domain , type , protocol=0) -> Array (427.0) -
相互に結合されたソケットのペアを含む2要素の配列を返します。 引数の指定は Socket.open と同じです。
...のペアを含む2要素の配列を返します。
引数の指定は Socket.open と同じです。
@param domain Socket.open を参照してください。
@param type Socket.open を参照してください。
@param protocol Socket.open を参照してください。
@see Socket.open... -
Socket
. socketpair(domain , type , protocol=0) -> Array (427.0) -
相互に結合されたソケットのペアを含む2要素の配列を返します。 引数の指定は Socket.open と同じです。
...のペアを含む2要素の配列を返します。
引数の指定は Socket.open と同じです。
@param domain Socket.open を参照してください。
@param type Socket.open を参照してください。
@param protocol Socket.open を参照してください。
@see Socket.open... -
Socket
. new(domain , type , protocol=0) -> Socket (310.0) -
新しいソケットを生成します。domain、type、 protocol はインクルードファイルにある定数で指定しま す。ほとんどの定数は Socket::AF_INET のように Socket クラスの定数として定義されています。domain とtype に関しては、"AF_INET", "SOCK_STREAM" のように文字列でも指定できますが、文 字列ですべての機能を指定できる保証はありません。
...します。domain、type、
protocol はインクルードファイルにある定数で指定しま
す。ほとんどの定数は Socket::AF_INET のように
Socket クラスの定数として定義されています。domain
とtype に関しては、"AF_INET",
"SOCK_STREAM" のように文字......りません。
例えば、IPv4 の TCP ソケットは以下のように生成されます。
require 'socket'
s = Socket.new(Socket::AF_INET, Socket::SOCK_STREAM, 0)
なお、socket(2) の domain 引数において AF_ と PF_ のどちらの定数を使用するかについては混乱......ここでは AF_ を使用しています。
@param domain 例えば、<sys/socket.h> のようなインクルードファイルに定義されている定数を指定します。
@param type 例えば、<sys/socket.h> のようなインクルードファイルに定義されている定数を...