rubysl-socket 2.0.1 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +70 -16
- data/lib/rubysl/socket.rb +201 -1396
- data/lib/rubysl/socket/ancillary_data.rb +56 -0
- data/lib/rubysl/socket/bsd.rb +28 -0
- data/lib/rubysl/socket/error.rb +67 -0
- data/lib/rubysl/socket/foreign.rb +324 -0
- data/lib/rubysl/socket/foreign/addrinfo.rb +10 -0
- data/lib/rubysl/socket/foreign/hostent.rb +36 -0
- data/lib/rubysl/socket/foreign/ifaddrs.rb +129 -0
- data/lib/rubysl/socket/foreign/iovec.rb +18 -0
- data/lib/rubysl/socket/foreign/linger.rb +41 -0
- data/lib/rubysl/socket/foreign/msghdr.rb +41 -0
- data/lib/rubysl/socket/foreign/servent.rb +17 -0
- data/lib/rubysl/socket/foreign/sockaddr.rb +21 -0
- data/lib/rubysl/socket/foreign/sockaddr_in.rb +25 -0
- data/lib/rubysl/socket/foreign/sockaddr_in6.rb +25 -0
- data/lib/rubysl/socket/foreign/sockaddr_un.rb +29 -0
- data/lib/rubysl/socket/ipv6.rb +38 -0
- data/lib/rubysl/socket/linux.rb +16 -0
- data/lib/rubysl/socket/socket_options.rb +84 -0
- data/lib/rubysl/socket/version.rb +1 -1
- data/lib/socket.rb +45 -1
- data/lib/socket/addrinfo.rb +453 -0
- data/lib/socket/ancillary_data.rb +114 -0
- data/lib/socket/basic_socket.rb +295 -0
- data/lib/socket/constants.rb +41 -0
- data/lib/socket/ifaddr.rb +29 -0
- data/lib/socket/ip_socket.rb +37 -0
- data/lib/socket/mri.rb +928 -0
- data/lib/socket/option.rb +96 -0
- data/lib/socket/socket.rb +353 -0
- data/lib/socket/socket_error.rb +2 -0
- data/lib/socket/tcp_server.rb +78 -0
- data/lib/socket/tcp_socket.rb +109 -0
- data/lib/socket/udp_socket.rb +73 -0
- data/lib/socket/unix_server.rb +35 -0
- data/lib/socket/unix_socket.rb +78 -0
- data/rubysl-socket.gemspec +15 -10
- metadata +78 -293
- data/.gitignore +0 -17
- data/.travis.yml +0 -9
- data/Gemfile +0 -4
- data/Rakefile +0 -1
- data/spec/addrinfo/afamily_spec.rb +0 -5
- data/spec/addrinfo/bind_spec.rb +0 -5
- data/spec/addrinfo/canonname_spec.rb +0 -5
- data/spec/addrinfo/connect_from_spec.rb +0 -5
- data/spec/addrinfo/connect_spec.rb +0 -5
- data/spec/addrinfo/connect_to_spec.rb +0 -5
- data/spec/addrinfo/family_addrinfo_spec.rb +0 -5
- data/spec/addrinfo/foreach_spec.rb +0 -5
- data/spec/addrinfo/getaddrinfo_spec.rb +0 -5
- data/spec/addrinfo/getnameinfo_spec.rb +0 -5
- data/spec/addrinfo/inspect_sockaddr_spec.rb +0 -5
- data/spec/addrinfo/inspect_spec.rb +0 -5
- data/spec/addrinfo/ip_address_spec.rb +0 -5
- data/spec/addrinfo/ip_port_spec.rb +0 -5
- data/spec/addrinfo/ip_spec.rb +0 -9
- data/spec/addrinfo/ip_unpack_spec.rb +0 -5
- data/spec/addrinfo/ipv4_loopback_spec.rb +0 -5
- data/spec/addrinfo/ipv4_multicast_spec.rb +0 -5
- data/spec/addrinfo/ipv4_private_spec.rb +0 -5
- data/spec/addrinfo/ipv4_spec.rb +0 -5
- data/spec/addrinfo/ipv6_linklocal_spec.rb +0 -5
- data/spec/addrinfo/ipv6_loopback_spec.rb +0 -5
- data/spec/addrinfo/ipv6_mc_global_spec.rb +0 -5
- data/spec/addrinfo/ipv6_mc_linklocal_spec.rb +0 -5
- data/spec/addrinfo/ipv6_mc_nodelocal_spec.rb +0 -5
- data/spec/addrinfo/ipv6_mc_orglocal_spec.rb +0 -5
- data/spec/addrinfo/ipv6_mc_sitelocal_spec.rb +0 -5
- data/spec/addrinfo/ipv6_multicast_spec.rb +0 -5
- data/spec/addrinfo/ipv6_sitelocal_spec.rb +0 -5
- data/spec/addrinfo/ipv6_spec.rb +0 -5
- data/spec/addrinfo/ipv6_to_ipv4_spec.rb +0 -5
- data/spec/addrinfo/ipv6_unspecified_spec.rb +0 -5
- data/spec/addrinfo/ipv6_v4compat_spec.rb +0 -5
- data/spec/addrinfo/ipv6_v4mapped_spec.rb +0 -5
- data/spec/addrinfo/listen_spec.rb +0 -5
- data/spec/addrinfo/marshal_dump_spec.rb +0 -5
- data/spec/addrinfo/marshal_load_spec.rb +0 -5
- data/spec/addrinfo/pfamily_spec.rb +0 -5
- data/spec/addrinfo/protocol_spec.rb +0 -5
- data/spec/addrinfo/socktype_spec.rb +0 -5
- data/spec/addrinfo/tcp_spec.rb +0 -5
- data/spec/addrinfo/to_s_spec.rb +0 -5
- data/spec/addrinfo/to_sockaddr_spec.rb +0 -5
- data/spec/addrinfo/udp_spec.rb +0 -5
- data/spec/addrinfo/unix_path_spec.rb +0 -5
- data/spec/addrinfo/unix_spec.rb +0 -9
- data/spec/basicsocket/close_read_spec.rb +0 -42
- data/spec/basicsocket/close_write_spec.rb +0 -42
- data/spec/basicsocket/do_not_reverse_lookup_spec.rb +0 -78
- data/spec/basicsocket/for_fd_spec.rb +0 -37
- data/spec/basicsocket/getpeername_spec.rb +0 -24
- data/spec/basicsocket/getsockname_spec.rb +0 -27
- data/spec/basicsocket/getsockopt_spec.rb +0 -54
- data/spec/basicsocket/ioctl_spec.rb +0 -22
- data/spec/basicsocket/recv_nonblock_spec.rb +0 -6
- data/spec/basicsocket/recv_spec.rb +0 -76
- data/spec/basicsocket/send_spec.rb +0 -81
- data/spec/basicsocket/setsockopt_spec.rb +0 -333
- data/spec/basicsocket/shutdown_spec.rb +0 -5
- data/spec/constants/constants_spec.rb +0 -63
- data/spec/fixtures/classes.rb +0 -174
- data/spec/fixtures/send_io.txt +0 -1
- data/spec/ipsocket/addr_spec.rb +0 -72
- data/spec/ipsocket/getaddress_spec.rb +0 -26
- data/spec/ipsocket/peeraddr_spec.rb +0 -79
- data/spec/ipsocket/recvfrom_spec.rb +0 -64
- data/spec/option/int_spec.rb +0 -27
- data/spec/option/linger_spec.rb +0 -52
- data/spec/option/new_spec.rb +0 -32
- data/spec/shared/pack_sockaddr.rb +0 -26
- data/spec/shared/partially_closable_sockets.rb +0 -13
- data/spec/shared/recv_nonblock.rb +0 -33
- data/spec/shared/socketpair.rb +0 -35
- data/spec/socket/accept_nonblock_spec.rb +0 -27
- data/spec/socket/accept_spec.rb +0 -1
- data/spec/socket/bind_spec.rb +0 -80
- data/spec/socket/connect_nonblock_spec.rb +0 -62
- data/spec/socket/connect_spec.rb +0 -1
- data/spec/socket/for_fd_spec.rb +0 -29
- data/spec/socket/getaddrinfo_spec.rb +0 -120
- data/spec/socket/gethostbyaddr_spec.rb +0 -1
- data/spec/socket/gethostbyname_spec.rb +0 -26
- data/spec/socket/gethostname_spec.rb +0 -9
- data/spec/socket/getnameinfo_spec.rb +0 -57
- data/spec/socket/getservbyname_spec.rb +0 -24
- data/spec/socket/listen_spec.rb +0 -21
- data/spec/socket/new_spec.rb +0 -109
- data/spec/socket/pack_sockaddr_in_spec.rb +0 -6
- data/spec/socket/pack_sockaddr_un_spec.rb +0 -6
- data/spec/socket/pair_spec.rb +0 -6
- data/spec/socket/recvfrom_nonblock_spec.rb +0 -1
- data/spec/socket/recvfrom_spec.rb +0 -1
- data/spec/socket/sockaddr_in_spec.rb +0 -6
- data/spec/socket/sockaddr_un_spec.rb +0 -6
- data/spec/socket/socket_spec.rb +0 -37
- data/spec/socket/socketpair_spec.rb +0 -6
- data/spec/socket/sysaccept_spec.rb +0 -1
- data/spec/socket/unpack_sockaddr_in_spec.rb +0 -16
- data/spec/socket/unpack_sockaddr_un_spec.rb +0 -2
- data/spec/tcpserver/accept_nonblock_spec.rb +0 -30
- data/spec/tcpserver/accept_spec.rb +0 -60
- data/spec/tcpserver/gets_spec.rb +0 -17
- data/spec/tcpserver/listen_spec.rb +0 -1
- data/spec/tcpserver/new_spec.rb +0 -88
- data/spec/tcpserver/output_spec.rb +0 -8
- data/spec/tcpserver/readpartial_spec.rb +0 -8
- data/spec/tcpserver/sysaccept_spec.rb +0 -1
- data/spec/tcpsocket/gethostbyname_spec.rb +0 -62
- data/spec/tcpsocket/new_spec.rb +0 -5
- data/spec/tcpsocket/open_spec.rb +0 -5
- data/spec/tcpsocket/partially_closable_spec.rb +0 -20
- data/spec/tcpsocket/recv_nonblock_spec.rb +0 -31
- data/spec/tcpsocket/setsockopt_spec.rb +0 -49
- data/spec/tcpsocket/shared/new.rb +0 -85
- data/spec/udpsocket/bind_spec.rb +0 -33
- data/spec/udpsocket/connect_spec.rb +0 -1
- data/spec/udpsocket/new_spec.rb +0 -1
- data/spec/udpsocket/open_spec.rb +0 -12
- data/spec/udpsocket/recvfrom_nonblock_spec.rb +0 -1
- data/spec/udpsocket/send_spec.rb +0 -57
- data/spec/unixserver/accept_nonblock_spec.rb +0 -33
- data/spec/unixserver/accept_spec.rb +0 -64
- data/spec/unixserver/for_fd_spec.rb +0 -32
- data/spec/unixserver/new_spec.rb +0 -5
- data/spec/unixserver/open_spec.rb +0 -25
- data/spec/unixserver/shared/new.rb +0 -23
- data/spec/unixsocket/addr_spec.rb +0 -37
- data/spec/unixsocket/new_spec.rb +0 -5
- data/spec/unixsocket/open_spec.rb +0 -26
- data/spec/unixsocket/pair_spec.rb +0 -38
- data/spec/unixsocket/partially_closable_spec.rb +0 -25
- data/spec/unixsocket/path_spec.rb +0 -29
- data/spec/unixsocket/peeraddr_spec.rb +0 -29
- data/spec/unixsocket/recv_io_spec.rb +0 -40
- data/spec/unixsocket/recvfrom_spec.rb +0 -48
- data/spec/unixsocket/send_io_spec.rb +0 -30
- data/spec/unixsocket/shared/new.rb +0 -25
@@ -0,0 +1,78 @@
|
|
1
|
+
class TCPServer < TCPSocket
|
2
|
+
def initialize(host, service = nil)
|
3
|
+
@no_reverse_lookup = self.class.do_not_reverse_lookup
|
4
|
+
|
5
|
+
if host.is_a?(Fixnum) and service.nil?
|
6
|
+
service = host
|
7
|
+
host = nil
|
8
|
+
end
|
9
|
+
|
10
|
+
if host.is_a?(String) and service.nil?
|
11
|
+
begin
|
12
|
+
service = Integer(host)
|
13
|
+
rescue ArgumentError
|
14
|
+
raise SocketError, "invalid port number: #{host}"
|
15
|
+
end
|
16
|
+
|
17
|
+
host = nil
|
18
|
+
end
|
19
|
+
|
20
|
+
unless service.is_a?(Fixnum)
|
21
|
+
service = RubySL::Socket.coerce_to_string(service)
|
22
|
+
end
|
23
|
+
|
24
|
+
if host
|
25
|
+
host = RubySL::Socket.coerce_to_string(host)
|
26
|
+
else
|
27
|
+
host = ''
|
28
|
+
end
|
29
|
+
|
30
|
+
remote_addrs = Socket
|
31
|
+
.getaddrinfo(host, service, :UNSPEC, :STREAM, 0, Socket::AI_PASSIVE)
|
32
|
+
|
33
|
+
remote_addrs.each do |addrinfo|
|
34
|
+
_, port, address, _, family, socktype, protocol = addrinfo
|
35
|
+
|
36
|
+
descriptor = RubySL::Socket::Foreign.socket(family, socktype, protocol)
|
37
|
+
|
38
|
+
next if descriptor < 0
|
39
|
+
|
40
|
+
status = RubySL::Socket::Foreign
|
41
|
+
.bind(descriptor, Socket.sockaddr_in(port, address))
|
42
|
+
|
43
|
+
if status < 0
|
44
|
+
RubySL::Socket::Foreign.close(descriptor)
|
45
|
+
|
46
|
+
Errno.handle('bind(2)')
|
47
|
+
else
|
48
|
+
IO.setup(self, descriptor, nil, true)
|
49
|
+
|
50
|
+
setsockopt(:SOCKET, :REUSEADDR, true)
|
51
|
+
|
52
|
+
break
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
listen(5)
|
57
|
+
end
|
58
|
+
|
59
|
+
def listen(backlog)
|
60
|
+
RubySL::Socket.listen(self, backlog)
|
61
|
+
end
|
62
|
+
|
63
|
+
def accept
|
64
|
+
socket, _ = RubySL::Socket.accept(self, TCPSocket)
|
65
|
+
|
66
|
+
socket
|
67
|
+
end
|
68
|
+
|
69
|
+
def accept_nonblock
|
70
|
+
socket, _ = RubySL::Socket.accept_nonblock(self, TCPSocket)
|
71
|
+
|
72
|
+
socket
|
73
|
+
end
|
74
|
+
|
75
|
+
def sysaccept
|
76
|
+
accept.fileno
|
77
|
+
end
|
78
|
+
end
|
@@ -0,0 +1,109 @@
|
|
1
|
+
class TCPSocket < IPSocket
|
2
|
+
def self.gethostbyname(hostname)
|
3
|
+
addrinfos = Socket
|
4
|
+
.getaddrinfo(hostname, nil, nil, :STREAM, nil, Socket::AI_CANONNAME)
|
5
|
+
|
6
|
+
hostname = addrinfos[0][2]
|
7
|
+
family = addrinfos[0][4]
|
8
|
+
addresses = addrinfos.map { |a| a[3] }
|
9
|
+
alternatives = []
|
10
|
+
|
11
|
+
RubySL::Socket.aliases_for_hostname(hostname).each do |name|
|
12
|
+
alternatives << name unless name == hostname
|
13
|
+
end
|
14
|
+
|
15
|
+
[hostname, alternatives, family, *addresses]
|
16
|
+
end
|
17
|
+
|
18
|
+
def initialize(host, service, local_host = nil, local_service = nil)
|
19
|
+
@no_reverse_lookup = self.class.do_not_reverse_lookup
|
20
|
+
|
21
|
+
if host
|
22
|
+
host = RubySL::Socket.coerce_to_string(host)
|
23
|
+
end
|
24
|
+
|
25
|
+
if service.is_a?(Fixnum)
|
26
|
+
service = service.to_s
|
27
|
+
else
|
28
|
+
service = RubySL::Socket.coerce_to_string(service)
|
29
|
+
end
|
30
|
+
|
31
|
+
local_addrinfo = nil
|
32
|
+
|
33
|
+
# When a local address and/or service/port are given we should bind the
|
34
|
+
# socket to said address (besides also connecting to the remote address).
|
35
|
+
if local_host or local_service
|
36
|
+
if local_host
|
37
|
+
local_host = RubySL::Socket.coerce_to_string(local_host)
|
38
|
+
end
|
39
|
+
|
40
|
+
if local_service.is_a?(Fixnum)
|
41
|
+
local_service = local_service.to_s
|
42
|
+
elsif local_service
|
43
|
+
local_service = RubySL::Socket.coerce_to_string(local_service)
|
44
|
+
end
|
45
|
+
|
46
|
+
local_addrinfo = Socket
|
47
|
+
.getaddrinfo(local_host, local_service, :UNSPEC, :STREAM)
|
48
|
+
end
|
49
|
+
|
50
|
+
descriptor = nil
|
51
|
+
connect_status = 0
|
52
|
+
|
53
|
+
# Because we don't know exactly what address family to bind to we'll just
|
54
|
+
# grab all the available ones and try every one of them, bailing out on the
|
55
|
+
# first address that we can connect to.
|
56
|
+
#
|
57
|
+
# This code is loosely based on the behaviour of CRuby's
|
58
|
+
# "init_inetsock_internal()" function as of Ruby 2.2.
|
59
|
+
Socket.getaddrinfo(host, service, :UNSPEC, :STREAM).each do |addrinfo|
|
60
|
+
_, port, address, _, family, socktype, protocol = addrinfo
|
61
|
+
|
62
|
+
descriptor = RubySL::Socket::Foreign.socket(family, socktype, protocol)
|
63
|
+
|
64
|
+
next if descriptor < 0
|
65
|
+
|
66
|
+
# If any local address details were given we should bind to one that
|
67
|
+
# matches the remote address connected to above.
|
68
|
+
if local_addrinfo
|
69
|
+
local_info = local_addrinfo.find do |addr|
|
70
|
+
addr[4] == family && addr[5] == socktype
|
71
|
+
end
|
72
|
+
|
73
|
+
if local_info
|
74
|
+
status = RubySL::Socket::Foreign
|
75
|
+
.bind(descriptor, Socket.sockaddr_in(local_info[1], local_info[2]))
|
76
|
+
|
77
|
+
Errno.handle('bind(2)') if status < 0
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
connect_status = RubySL::Socket::Foreign
|
82
|
+
.connect(descriptor, Socket.sockaddr_in(port, address))
|
83
|
+
|
84
|
+
break if connect_status >= 0
|
85
|
+
end
|
86
|
+
|
87
|
+
if connect_status < 0
|
88
|
+
RubySL::Socket::Foreign.close(descriptor)
|
89
|
+
|
90
|
+
Errno.handle('connect(2)')
|
91
|
+
else
|
92
|
+
IO.setup(self, descriptor, nil, true)
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
def local_address
|
97
|
+
address = addr
|
98
|
+
sockaddr = Socket.pack_sockaddr_in(address[1], address[3])
|
99
|
+
|
100
|
+
Addrinfo.new(sockaddr, address[0], :STREAM)
|
101
|
+
end
|
102
|
+
|
103
|
+
def remote_address
|
104
|
+
address = peeraddr
|
105
|
+
sockaddr = Socket.pack_sockaddr_in(address[1], address[3])
|
106
|
+
|
107
|
+
Addrinfo.new(sockaddr, address[0], :STREAM)
|
108
|
+
end
|
109
|
+
end
|
@@ -0,0 +1,73 @@
|
|
1
|
+
class UDPSocket < IPSocket
|
2
|
+
def initialize(family = Socket::AF_INET)
|
3
|
+
@no_reverse_lookup = self.class.do_not_reverse_lookup
|
4
|
+
@family = RubySL::Socket.address_family(family)
|
5
|
+
|
6
|
+
descriptor = RubySL::Socket::Foreign
|
7
|
+
.socket(@family, Socket::SOCK_DGRAM, Socket::IPPROTO_UDP)
|
8
|
+
|
9
|
+
Errno.handle('socket(2)') if descriptor < 0
|
10
|
+
|
11
|
+
IO.setup(self, descriptor, nil, true)
|
12
|
+
end
|
13
|
+
|
14
|
+
def bind(host, port)
|
15
|
+
addr = Socket.sockaddr_in(port.to_i, host)
|
16
|
+
status = RubySL::Socket::Foreign.bind(descriptor, addr)
|
17
|
+
|
18
|
+
Errno.handle('bind(2)') if status < 0
|
19
|
+
|
20
|
+
0
|
21
|
+
end
|
22
|
+
|
23
|
+
def connect(host, port)
|
24
|
+
sockaddr = RubySL::Socket::Foreign
|
25
|
+
.pack_sockaddr_in(host, port.to_i, @family, Socket::SOCK_DGRAM, 0)
|
26
|
+
|
27
|
+
status = RubySL::Socket::Foreign.connect(descriptor, sockaddr)
|
28
|
+
|
29
|
+
RubySL::Socket::Error.write_error('connect(2)', self) if status < 0
|
30
|
+
|
31
|
+
0
|
32
|
+
end
|
33
|
+
|
34
|
+
def send(message, flags, host = nil, port = nil)
|
35
|
+
if host and port
|
36
|
+
addr = Socket.sockaddr_in(port.to_i, host)
|
37
|
+
elsif host
|
38
|
+
addr = host
|
39
|
+
else
|
40
|
+
addr = nil
|
41
|
+
end
|
42
|
+
|
43
|
+
super(message, flags, addr)
|
44
|
+
end
|
45
|
+
|
46
|
+
def recvfrom_nonblock(maxlen, flags = 0)
|
47
|
+
fcntl(Fcntl::F_SETFL, Fcntl::O_NONBLOCK)
|
48
|
+
|
49
|
+
flags = 0 if flags.nil?
|
50
|
+
|
51
|
+
flags |= Socket::MSG_DONTWAIT
|
52
|
+
|
53
|
+
recvfrom(maxlen, flags)
|
54
|
+
end
|
55
|
+
|
56
|
+
def inspect
|
57
|
+
"#<#{self.class}:fd #{fileno}>"
|
58
|
+
end
|
59
|
+
|
60
|
+
def local_address
|
61
|
+
address = addr
|
62
|
+
sockaddr = Socket.pack_sockaddr_in(address[1], address[3])
|
63
|
+
|
64
|
+
Addrinfo.new(sockaddr, address[0], :DGRAM)
|
65
|
+
end
|
66
|
+
|
67
|
+
def remote_address
|
68
|
+
address = peeraddr
|
69
|
+
sockaddr = Socket.pack_sockaddr_in(address[1], address[3])
|
70
|
+
|
71
|
+
Addrinfo.new(sockaddr, address[0], :DGRAM)
|
72
|
+
end
|
73
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
class UNIXServer < UNIXSocket
|
2
|
+
def initialize(path)
|
3
|
+
@no_reverse_lookup = self.class.do_not_reverse_lookup
|
4
|
+
@path = path
|
5
|
+
|
6
|
+
fd = RubySL::Socket::Foreign.socket(Socket::AF_UNIX, Socket::SOCK_STREAM, 0)
|
7
|
+
|
8
|
+
Errno.handle('socket(2)') if fd < 0
|
9
|
+
|
10
|
+
IO.setup(self, fd, 'r+', true)
|
11
|
+
|
12
|
+
sockaddr = Socket.sockaddr_un(@path)
|
13
|
+
status = RubySL::Socket::Foreign.bind(descriptor, sockaddr)
|
14
|
+
|
15
|
+
Errno.handle('bind(2)') if status < 0
|
16
|
+
|
17
|
+
listen(Socket::SOMAXCONN)
|
18
|
+
end
|
19
|
+
|
20
|
+
def listen(backlog)
|
21
|
+
RubySL::Socket.listen(self, backlog)
|
22
|
+
end
|
23
|
+
|
24
|
+
def accept
|
25
|
+
RubySL::Socket.accept(self, UNIXSocket)[0]
|
26
|
+
end
|
27
|
+
|
28
|
+
def accept_nonblock
|
29
|
+
RubySL::Socket.accept_nonblock(self, UNIXSocket)[0]
|
30
|
+
end
|
31
|
+
|
32
|
+
def sysaccept
|
33
|
+
accept.fileno
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,78 @@
|
|
1
|
+
class UNIXSocket < BasicSocket
|
2
|
+
include IO::TransferIO
|
3
|
+
|
4
|
+
def self.socketpair(type = Socket::SOCK_STREAM, protocol = 0)
|
5
|
+
family = Socket::AF_UNIX
|
6
|
+
type = RubySL::Socket.socket_type(type)
|
7
|
+
|
8
|
+
fd0, fd1 = RubySL::Socket::Foreign.socketpair(family, type, protocol)
|
9
|
+
|
10
|
+
[for_fd(fd0), for_fd(fd1)]
|
11
|
+
end
|
12
|
+
|
13
|
+
class << self
|
14
|
+
alias_method :pair, :socketpair
|
15
|
+
end
|
16
|
+
|
17
|
+
def initialize(path)
|
18
|
+
@no_reverse_lookup = self.class.do_not_reverse_lookup
|
19
|
+
@path = '' # empty for client sockets
|
20
|
+
|
21
|
+
fd = RubySL::Socket::Foreign.socket(Socket::AF_UNIX, Socket::SOCK_STREAM, 0)
|
22
|
+
|
23
|
+
Errno.handle('socket(2)') if fd < 0
|
24
|
+
|
25
|
+
IO.setup(self, fd, 'r+', true)
|
26
|
+
|
27
|
+
sockaddr = Socket.sockaddr_un(path)
|
28
|
+
status = RubySL::Socket::Foreign.connect(descriptor, sockaddr)
|
29
|
+
|
30
|
+
Errno.handle('connect(2)') if status < 0
|
31
|
+
end
|
32
|
+
|
33
|
+
def recvfrom(bytes_read, flags = 0)
|
34
|
+
socket_recv(bytes_read, flags, 2)
|
35
|
+
end
|
36
|
+
|
37
|
+
def path
|
38
|
+
@path ||= RubySL::Socket::Foreign.getsockname(descriptor).unpack('SZ*')[1]
|
39
|
+
end
|
40
|
+
|
41
|
+
def addr
|
42
|
+
['AF_UNIX', path]
|
43
|
+
end
|
44
|
+
|
45
|
+
def peeraddr
|
46
|
+
path = RubySL::Socket::Foreign.getpeername(descriptor).unpack('SZ*')[1]
|
47
|
+
|
48
|
+
['AF_UNIX', path]
|
49
|
+
end
|
50
|
+
|
51
|
+
def recv_io(klass = IO, mode = nil)
|
52
|
+
begin
|
53
|
+
fd = recv_fd
|
54
|
+
rescue PrimitiveFailure
|
55
|
+
raise SocketError, "file descriptor was not passed"
|
56
|
+
end
|
57
|
+
|
58
|
+
return fd unless klass
|
59
|
+
|
60
|
+
if klass.is_a?(BasicSocket)
|
61
|
+
klass.for_fd(fd)
|
62
|
+
else
|
63
|
+
klass.for_fd(fd, mode)
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
def local_address
|
68
|
+
address = addr
|
69
|
+
|
70
|
+
Addrinfo.new(Socket.pack_sockaddr_un(address[1]), :UNIX, :STREAM)
|
71
|
+
end
|
72
|
+
|
73
|
+
def remote_address
|
74
|
+
address = peeraddr
|
75
|
+
|
76
|
+
Addrinfo.new(Socket.pack_sockaddr_un(address[1]), :UNIX, :STREAM)
|
77
|
+
end
|
78
|
+
end
|
data/rubysl-socket.gemspec
CHANGED
@@ -4,22 +4,27 @@ require './lib/rubysl/socket/version'
|
|
4
4
|
Gem::Specification.new do |spec|
|
5
5
|
spec.name = "rubysl-socket"
|
6
6
|
spec.version = RubySL::Socket::VERSION
|
7
|
-
spec.authors = ["Brian Shirai"]
|
8
|
-
spec.email = ["brixen@gmail.com"]
|
9
|
-
spec.description = %q{
|
10
|
-
spec.summary = %q{
|
7
|
+
spec.authors = ["Brian Shirai", "Yorick Peterse"]
|
8
|
+
spec.email = ["brixen@gmail.com", "yorickpeterse@gmail.com"]
|
9
|
+
spec.description = %q{Socket standard library for Rubinius.}
|
10
|
+
spec.summary = %q{Socket standard library for Rubinius.}
|
11
11
|
spec.homepage = "https://github.com/rubysl/rubysl-socket"
|
12
12
|
spec.license = "BSD"
|
13
13
|
|
14
|
-
spec.files
|
15
|
-
|
16
|
-
|
17
|
-
|
14
|
+
spec.files = Dir.glob([
|
15
|
+
'lib/**/*.*',
|
16
|
+
'LICENSE',
|
17
|
+
'README.md',
|
18
|
+
'rubysl-socket.gemspec'
|
19
|
+
])
|
18
20
|
|
19
|
-
spec.required_ruby_version =
|
21
|
+
spec.required_ruby_version = '~> 2.0'
|
22
|
+
|
23
|
+
spec.add_dependency 'rubysl-fcntl', '~> 2.0'
|
20
24
|
|
21
25
|
spec.add_development_dependency "bundler", "~> 1.3"
|
22
26
|
spec.add_development_dependency "rake", "~> 10.0"
|
23
|
-
spec.add_development_dependency "mspec", "~> 1.
|
27
|
+
spec.add_development_dependency "mspec", "~> 1.9"
|
24
28
|
spec.add_development_dependency "rubysl-prettyprint", "~> 2.0"
|
29
|
+
spec.add_development_dependency "rubysl-ipaddr", "~> 2.0"
|
25
30
|
end
|
metadata
CHANGED
@@ -1,225 +1,147 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubysl-socket
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Shirai
|
8
|
+
- Yorick Peterse
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date:
|
12
|
+
date: 2016-01-08 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
|
-
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '2.0'
|
20
|
+
name: rubysl-fcntl
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '2.0'
|
27
|
+
type: :runtime
|
28
|
+
- !ruby/object:Gem::Dependency
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
16
30
|
requirements:
|
17
31
|
- - "~>"
|
18
32
|
- !ruby/object:Gem::Version
|
19
33
|
version: '1.3'
|
20
|
-
|
34
|
+
name: bundler
|
21
35
|
prerelease: false
|
22
36
|
version_requirements: !ruby/object:Gem::Requirement
|
23
37
|
requirements:
|
24
38
|
- - "~>"
|
25
39
|
- !ruby/object:Gem::Version
|
26
40
|
version: '1.3'
|
41
|
+
type: :development
|
27
42
|
- !ruby/object:Gem::Dependency
|
28
|
-
name: rake
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
30
44
|
requirements:
|
31
45
|
- - "~>"
|
32
46
|
- !ruby/object:Gem::Version
|
33
47
|
version: '10.0'
|
34
|
-
|
48
|
+
name: rake
|
35
49
|
prerelease: false
|
36
50
|
version_requirements: !ruby/object:Gem::Requirement
|
37
51
|
requirements:
|
38
52
|
- - "~>"
|
39
53
|
- !ruby/object:Gem::Version
|
40
54
|
version: '10.0'
|
55
|
+
type: :development
|
41
56
|
- !ruby/object:Gem::Dependency
|
42
|
-
name: mspec
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
44
58
|
requirements:
|
45
59
|
- - "~>"
|
46
60
|
- !ruby/object:Gem::Version
|
47
|
-
version: '1.
|
48
|
-
|
61
|
+
version: '1.9'
|
62
|
+
name: mspec
|
49
63
|
prerelease: false
|
50
64
|
version_requirements: !ruby/object:Gem::Requirement
|
51
65
|
requirements:
|
52
66
|
- - "~>"
|
53
67
|
- !ruby/object:Gem::Version
|
54
|
-
version: '1.
|
68
|
+
version: '1.9'
|
69
|
+
type: :development
|
55
70
|
- !ruby/object:Gem::Dependency
|
56
|
-
name: rubysl-prettyprint
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
58
72
|
requirements:
|
59
73
|
- - "~>"
|
60
74
|
- !ruby/object:Gem::Version
|
61
75
|
version: '2.0'
|
76
|
+
name: rubysl-prettyprint
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '2.0'
|
62
83
|
type: :development
|
84
|
+
- !ruby/object:Gem::Dependency
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '2.0'
|
90
|
+
name: rubysl-ipaddr
|
63
91
|
prerelease: false
|
64
92
|
version_requirements: !ruby/object:Gem::Requirement
|
65
93
|
requirements:
|
66
94
|
- - "~>"
|
67
95
|
- !ruby/object:Gem::Version
|
68
96
|
version: '2.0'
|
69
|
-
|
97
|
+
type: :development
|
98
|
+
description: Socket standard library for Rubinius.
|
70
99
|
email:
|
71
100
|
- brixen@gmail.com
|
101
|
+
- yorickpeterse@gmail.com
|
72
102
|
executables: []
|
73
103
|
extensions: []
|
74
104
|
extra_rdoc_files: []
|
75
105
|
files:
|
76
|
-
- ".gitignore"
|
77
|
-
- ".travis.yml"
|
78
|
-
- Gemfile
|
79
106
|
- LICENSE
|
80
107
|
- README.md
|
81
|
-
- Rakefile
|
82
108
|
- lib/rubysl/socket.rb
|
109
|
+
- lib/rubysl/socket/ancillary_data.rb
|
110
|
+
- lib/rubysl/socket/bsd.rb
|
111
|
+
- lib/rubysl/socket/error.rb
|
112
|
+
- lib/rubysl/socket/foreign.rb
|
113
|
+
- lib/rubysl/socket/foreign/addrinfo.rb
|
114
|
+
- lib/rubysl/socket/foreign/hostent.rb
|
115
|
+
- lib/rubysl/socket/foreign/ifaddrs.rb
|
116
|
+
- lib/rubysl/socket/foreign/iovec.rb
|
117
|
+
- lib/rubysl/socket/foreign/linger.rb
|
118
|
+
- lib/rubysl/socket/foreign/msghdr.rb
|
119
|
+
- lib/rubysl/socket/foreign/servent.rb
|
120
|
+
- lib/rubysl/socket/foreign/sockaddr.rb
|
121
|
+
- lib/rubysl/socket/foreign/sockaddr_in.rb
|
122
|
+
- lib/rubysl/socket/foreign/sockaddr_in6.rb
|
123
|
+
- lib/rubysl/socket/foreign/sockaddr_un.rb
|
124
|
+
- lib/rubysl/socket/ipv6.rb
|
125
|
+
- lib/rubysl/socket/linux.rb
|
126
|
+
- lib/rubysl/socket/socket_options.rb
|
83
127
|
- lib/rubysl/socket/version.rb
|
84
128
|
- lib/socket.rb
|
129
|
+
- lib/socket/addrinfo.rb
|
130
|
+
- lib/socket/ancillary_data.rb
|
131
|
+
- lib/socket/basic_socket.rb
|
132
|
+
- lib/socket/constants.rb
|
133
|
+
- lib/socket/ifaddr.rb
|
134
|
+
- lib/socket/ip_socket.rb
|
135
|
+
- lib/socket/mri.rb
|
136
|
+
- lib/socket/option.rb
|
137
|
+
- lib/socket/socket.rb
|
138
|
+
- lib/socket/socket_error.rb
|
139
|
+
- lib/socket/tcp_server.rb
|
140
|
+
- lib/socket/tcp_socket.rb
|
141
|
+
- lib/socket/udp_socket.rb
|
142
|
+
- lib/socket/unix_server.rb
|
143
|
+
- lib/socket/unix_socket.rb
|
85
144
|
- rubysl-socket.gemspec
|
86
|
-
- spec/addrinfo/afamily_spec.rb
|
87
|
-
- spec/addrinfo/bind_spec.rb
|
88
|
-
- spec/addrinfo/canonname_spec.rb
|
89
|
-
- spec/addrinfo/connect_from_spec.rb
|
90
|
-
- spec/addrinfo/connect_spec.rb
|
91
|
-
- spec/addrinfo/connect_to_spec.rb
|
92
|
-
- spec/addrinfo/family_addrinfo_spec.rb
|
93
|
-
- spec/addrinfo/foreach_spec.rb
|
94
|
-
- spec/addrinfo/getaddrinfo_spec.rb
|
95
|
-
- spec/addrinfo/getnameinfo_spec.rb
|
96
|
-
- spec/addrinfo/inspect_sockaddr_spec.rb
|
97
|
-
- spec/addrinfo/inspect_spec.rb
|
98
|
-
- spec/addrinfo/ip_address_spec.rb
|
99
|
-
- spec/addrinfo/ip_port_spec.rb
|
100
|
-
- spec/addrinfo/ip_spec.rb
|
101
|
-
- spec/addrinfo/ip_unpack_spec.rb
|
102
|
-
- spec/addrinfo/ipv4_loopback_spec.rb
|
103
|
-
- spec/addrinfo/ipv4_multicast_spec.rb
|
104
|
-
- spec/addrinfo/ipv4_private_spec.rb
|
105
|
-
- spec/addrinfo/ipv4_spec.rb
|
106
|
-
- spec/addrinfo/ipv6_linklocal_spec.rb
|
107
|
-
- spec/addrinfo/ipv6_loopback_spec.rb
|
108
|
-
- spec/addrinfo/ipv6_mc_global_spec.rb
|
109
|
-
- spec/addrinfo/ipv6_mc_linklocal_spec.rb
|
110
|
-
- spec/addrinfo/ipv6_mc_nodelocal_spec.rb
|
111
|
-
- spec/addrinfo/ipv6_mc_orglocal_spec.rb
|
112
|
-
- spec/addrinfo/ipv6_mc_sitelocal_spec.rb
|
113
|
-
- spec/addrinfo/ipv6_multicast_spec.rb
|
114
|
-
- spec/addrinfo/ipv6_sitelocal_spec.rb
|
115
|
-
- spec/addrinfo/ipv6_spec.rb
|
116
|
-
- spec/addrinfo/ipv6_to_ipv4_spec.rb
|
117
|
-
- spec/addrinfo/ipv6_unspecified_spec.rb
|
118
|
-
- spec/addrinfo/ipv6_v4compat_spec.rb
|
119
|
-
- spec/addrinfo/ipv6_v4mapped_spec.rb
|
120
|
-
- spec/addrinfo/listen_spec.rb
|
121
|
-
- spec/addrinfo/marshal_dump_spec.rb
|
122
|
-
- spec/addrinfo/marshal_load_spec.rb
|
123
|
-
- spec/addrinfo/pfamily_spec.rb
|
124
|
-
- spec/addrinfo/protocol_spec.rb
|
125
|
-
- spec/addrinfo/socktype_spec.rb
|
126
|
-
- spec/addrinfo/tcp_spec.rb
|
127
|
-
- spec/addrinfo/to_s_spec.rb
|
128
|
-
- spec/addrinfo/to_sockaddr_spec.rb
|
129
|
-
- spec/addrinfo/udp_spec.rb
|
130
|
-
- spec/addrinfo/unix_path_spec.rb
|
131
|
-
- spec/addrinfo/unix_spec.rb
|
132
|
-
- spec/basicsocket/close_read_spec.rb
|
133
|
-
- spec/basicsocket/close_write_spec.rb
|
134
|
-
- spec/basicsocket/do_not_reverse_lookup_spec.rb
|
135
|
-
- spec/basicsocket/for_fd_spec.rb
|
136
|
-
- spec/basicsocket/getpeername_spec.rb
|
137
|
-
- spec/basicsocket/getsockname_spec.rb
|
138
|
-
- spec/basicsocket/getsockopt_spec.rb
|
139
|
-
- spec/basicsocket/ioctl_spec.rb
|
140
|
-
- spec/basicsocket/recv_nonblock_spec.rb
|
141
|
-
- spec/basicsocket/recv_spec.rb
|
142
|
-
- spec/basicsocket/send_spec.rb
|
143
|
-
- spec/basicsocket/setsockopt_spec.rb
|
144
|
-
- spec/basicsocket/shutdown_spec.rb
|
145
|
-
- spec/constants/constants_spec.rb
|
146
|
-
- spec/fixtures/classes.rb
|
147
|
-
- spec/fixtures/send_io.txt
|
148
|
-
- spec/ipsocket/addr_spec.rb
|
149
|
-
- spec/ipsocket/getaddress_spec.rb
|
150
|
-
- spec/ipsocket/peeraddr_spec.rb
|
151
|
-
- spec/ipsocket/recvfrom_spec.rb
|
152
|
-
- spec/option/int_spec.rb
|
153
|
-
- spec/option/linger_spec.rb
|
154
|
-
- spec/option/new_spec.rb
|
155
|
-
- spec/shared/pack_sockaddr.rb
|
156
|
-
- spec/shared/partially_closable_sockets.rb
|
157
|
-
- spec/shared/recv_nonblock.rb
|
158
|
-
- spec/shared/socketpair.rb
|
159
|
-
- spec/socket/accept_nonblock_spec.rb
|
160
|
-
- spec/socket/accept_spec.rb
|
161
|
-
- spec/socket/bind_spec.rb
|
162
|
-
- spec/socket/connect_nonblock_spec.rb
|
163
|
-
- spec/socket/connect_spec.rb
|
164
|
-
- spec/socket/for_fd_spec.rb
|
165
|
-
- spec/socket/getaddrinfo_spec.rb
|
166
|
-
- spec/socket/gethostbyaddr_spec.rb
|
167
|
-
- spec/socket/gethostbyname_spec.rb
|
168
|
-
- spec/socket/gethostname_spec.rb
|
169
|
-
- spec/socket/getnameinfo_spec.rb
|
170
|
-
- spec/socket/getservbyname_spec.rb
|
171
|
-
- spec/socket/listen_spec.rb
|
172
|
-
- spec/socket/new_spec.rb
|
173
|
-
- spec/socket/pack_sockaddr_in_spec.rb
|
174
|
-
- spec/socket/pack_sockaddr_un_spec.rb
|
175
|
-
- spec/socket/pair_spec.rb
|
176
|
-
- spec/socket/recvfrom_nonblock_spec.rb
|
177
|
-
- spec/socket/recvfrom_spec.rb
|
178
|
-
- spec/socket/sockaddr_in_spec.rb
|
179
|
-
- spec/socket/sockaddr_un_spec.rb
|
180
|
-
- spec/socket/socket_spec.rb
|
181
|
-
- spec/socket/socketpair_spec.rb
|
182
|
-
- spec/socket/sysaccept_spec.rb
|
183
|
-
- spec/socket/unpack_sockaddr_in_spec.rb
|
184
|
-
- spec/socket/unpack_sockaddr_un_spec.rb
|
185
|
-
- spec/tcpserver/accept_nonblock_spec.rb
|
186
|
-
- spec/tcpserver/accept_spec.rb
|
187
|
-
- spec/tcpserver/gets_spec.rb
|
188
|
-
- spec/tcpserver/listen_spec.rb
|
189
|
-
- spec/tcpserver/new_spec.rb
|
190
|
-
- spec/tcpserver/output_spec.rb
|
191
|
-
- spec/tcpserver/readpartial_spec.rb
|
192
|
-
- spec/tcpserver/sysaccept_spec.rb
|
193
|
-
- spec/tcpsocket/gethostbyname_spec.rb
|
194
|
-
- spec/tcpsocket/new_spec.rb
|
195
|
-
- spec/tcpsocket/open_spec.rb
|
196
|
-
- spec/tcpsocket/partially_closable_spec.rb
|
197
|
-
- spec/tcpsocket/recv_nonblock_spec.rb
|
198
|
-
- spec/tcpsocket/setsockopt_spec.rb
|
199
|
-
- spec/tcpsocket/shared/new.rb
|
200
|
-
- spec/udpsocket/bind_spec.rb
|
201
|
-
- spec/udpsocket/connect_spec.rb
|
202
|
-
- spec/udpsocket/new_spec.rb
|
203
|
-
- spec/udpsocket/open_spec.rb
|
204
|
-
- spec/udpsocket/recvfrom_nonblock_spec.rb
|
205
|
-
- spec/udpsocket/send_spec.rb
|
206
|
-
- spec/unixserver/accept_nonblock_spec.rb
|
207
|
-
- spec/unixserver/accept_spec.rb
|
208
|
-
- spec/unixserver/for_fd_spec.rb
|
209
|
-
- spec/unixserver/new_spec.rb
|
210
|
-
- spec/unixserver/open_spec.rb
|
211
|
-
- spec/unixserver/shared/new.rb
|
212
|
-
- spec/unixsocket/addr_spec.rb
|
213
|
-
- spec/unixsocket/new_spec.rb
|
214
|
-
- spec/unixsocket/open_spec.rb
|
215
|
-
- spec/unixsocket/pair_spec.rb
|
216
|
-
- spec/unixsocket/partially_closable_spec.rb
|
217
|
-
- spec/unixsocket/path_spec.rb
|
218
|
-
- spec/unixsocket/peeraddr_spec.rb
|
219
|
-
- spec/unixsocket/recv_io_spec.rb
|
220
|
-
- spec/unixsocket/recvfrom_spec.rb
|
221
|
-
- spec/unixsocket/send_io_spec.rb
|
222
|
-
- spec/unixsocket/shared/new.rb
|
223
145
|
homepage: https://github.com/rubysl/rubysl-socket
|
224
146
|
licenses:
|
225
147
|
- BSD
|
@@ -240,146 +162,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
240
162
|
version: '0'
|
241
163
|
requirements: []
|
242
164
|
rubyforge_project:
|
243
|
-
rubygems_version: 2.
|
165
|
+
rubygems_version: 2.5.1
|
244
166
|
signing_key:
|
245
167
|
specification_version: 4
|
246
|
-
summary:
|
247
|
-
test_files:
|
248
|
-
- spec/addrinfo/afamily_spec.rb
|
249
|
-
- spec/addrinfo/bind_spec.rb
|
250
|
-
- spec/addrinfo/canonname_spec.rb
|
251
|
-
- spec/addrinfo/connect_from_spec.rb
|
252
|
-
- spec/addrinfo/connect_spec.rb
|
253
|
-
- spec/addrinfo/connect_to_spec.rb
|
254
|
-
- spec/addrinfo/family_addrinfo_spec.rb
|
255
|
-
- spec/addrinfo/foreach_spec.rb
|
256
|
-
- spec/addrinfo/getaddrinfo_spec.rb
|
257
|
-
- spec/addrinfo/getnameinfo_spec.rb
|
258
|
-
- spec/addrinfo/inspect_sockaddr_spec.rb
|
259
|
-
- spec/addrinfo/inspect_spec.rb
|
260
|
-
- spec/addrinfo/ip_address_spec.rb
|
261
|
-
- spec/addrinfo/ip_port_spec.rb
|
262
|
-
- spec/addrinfo/ip_spec.rb
|
263
|
-
- spec/addrinfo/ip_unpack_spec.rb
|
264
|
-
- spec/addrinfo/ipv4_loopback_spec.rb
|
265
|
-
- spec/addrinfo/ipv4_multicast_spec.rb
|
266
|
-
- spec/addrinfo/ipv4_private_spec.rb
|
267
|
-
- spec/addrinfo/ipv4_spec.rb
|
268
|
-
- spec/addrinfo/ipv6_linklocal_spec.rb
|
269
|
-
- spec/addrinfo/ipv6_loopback_spec.rb
|
270
|
-
- spec/addrinfo/ipv6_mc_global_spec.rb
|
271
|
-
- spec/addrinfo/ipv6_mc_linklocal_spec.rb
|
272
|
-
- spec/addrinfo/ipv6_mc_nodelocal_spec.rb
|
273
|
-
- spec/addrinfo/ipv6_mc_orglocal_spec.rb
|
274
|
-
- spec/addrinfo/ipv6_mc_sitelocal_spec.rb
|
275
|
-
- spec/addrinfo/ipv6_multicast_spec.rb
|
276
|
-
- spec/addrinfo/ipv6_sitelocal_spec.rb
|
277
|
-
- spec/addrinfo/ipv6_spec.rb
|
278
|
-
- spec/addrinfo/ipv6_to_ipv4_spec.rb
|
279
|
-
- spec/addrinfo/ipv6_unspecified_spec.rb
|
280
|
-
- spec/addrinfo/ipv6_v4compat_spec.rb
|
281
|
-
- spec/addrinfo/ipv6_v4mapped_spec.rb
|
282
|
-
- spec/addrinfo/listen_spec.rb
|
283
|
-
- spec/addrinfo/marshal_dump_spec.rb
|
284
|
-
- spec/addrinfo/marshal_load_spec.rb
|
285
|
-
- spec/addrinfo/pfamily_spec.rb
|
286
|
-
- spec/addrinfo/protocol_spec.rb
|
287
|
-
- spec/addrinfo/socktype_spec.rb
|
288
|
-
- spec/addrinfo/tcp_spec.rb
|
289
|
-
- spec/addrinfo/to_s_spec.rb
|
290
|
-
- spec/addrinfo/to_sockaddr_spec.rb
|
291
|
-
- spec/addrinfo/udp_spec.rb
|
292
|
-
- spec/addrinfo/unix_path_spec.rb
|
293
|
-
- spec/addrinfo/unix_spec.rb
|
294
|
-
- spec/basicsocket/close_read_spec.rb
|
295
|
-
- spec/basicsocket/close_write_spec.rb
|
296
|
-
- spec/basicsocket/do_not_reverse_lookup_spec.rb
|
297
|
-
- spec/basicsocket/for_fd_spec.rb
|
298
|
-
- spec/basicsocket/getpeername_spec.rb
|
299
|
-
- spec/basicsocket/getsockname_spec.rb
|
300
|
-
- spec/basicsocket/getsockopt_spec.rb
|
301
|
-
- spec/basicsocket/ioctl_spec.rb
|
302
|
-
- spec/basicsocket/recv_nonblock_spec.rb
|
303
|
-
- spec/basicsocket/recv_spec.rb
|
304
|
-
- spec/basicsocket/send_spec.rb
|
305
|
-
- spec/basicsocket/setsockopt_spec.rb
|
306
|
-
- spec/basicsocket/shutdown_spec.rb
|
307
|
-
- spec/constants/constants_spec.rb
|
308
|
-
- spec/fixtures/classes.rb
|
309
|
-
- spec/fixtures/send_io.txt
|
310
|
-
- spec/ipsocket/addr_spec.rb
|
311
|
-
- spec/ipsocket/getaddress_spec.rb
|
312
|
-
- spec/ipsocket/peeraddr_spec.rb
|
313
|
-
- spec/ipsocket/recvfrom_spec.rb
|
314
|
-
- spec/option/int_spec.rb
|
315
|
-
- spec/option/linger_spec.rb
|
316
|
-
- spec/option/new_spec.rb
|
317
|
-
- spec/shared/pack_sockaddr.rb
|
318
|
-
- spec/shared/partially_closable_sockets.rb
|
319
|
-
- spec/shared/recv_nonblock.rb
|
320
|
-
- spec/shared/socketpair.rb
|
321
|
-
- spec/socket/accept_nonblock_spec.rb
|
322
|
-
- spec/socket/accept_spec.rb
|
323
|
-
- spec/socket/bind_spec.rb
|
324
|
-
- spec/socket/connect_nonblock_spec.rb
|
325
|
-
- spec/socket/connect_spec.rb
|
326
|
-
- spec/socket/for_fd_spec.rb
|
327
|
-
- spec/socket/getaddrinfo_spec.rb
|
328
|
-
- spec/socket/gethostbyaddr_spec.rb
|
329
|
-
- spec/socket/gethostbyname_spec.rb
|
330
|
-
- spec/socket/gethostname_spec.rb
|
331
|
-
- spec/socket/getnameinfo_spec.rb
|
332
|
-
- spec/socket/getservbyname_spec.rb
|
333
|
-
- spec/socket/listen_spec.rb
|
334
|
-
- spec/socket/new_spec.rb
|
335
|
-
- spec/socket/pack_sockaddr_in_spec.rb
|
336
|
-
- spec/socket/pack_sockaddr_un_spec.rb
|
337
|
-
- spec/socket/pair_spec.rb
|
338
|
-
- spec/socket/recvfrom_nonblock_spec.rb
|
339
|
-
- spec/socket/recvfrom_spec.rb
|
340
|
-
- spec/socket/sockaddr_in_spec.rb
|
341
|
-
- spec/socket/sockaddr_un_spec.rb
|
342
|
-
- spec/socket/socket_spec.rb
|
343
|
-
- spec/socket/socketpair_spec.rb
|
344
|
-
- spec/socket/sysaccept_spec.rb
|
345
|
-
- spec/socket/unpack_sockaddr_in_spec.rb
|
346
|
-
- spec/socket/unpack_sockaddr_un_spec.rb
|
347
|
-
- spec/tcpserver/accept_nonblock_spec.rb
|
348
|
-
- spec/tcpserver/accept_spec.rb
|
349
|
-
- spec/tcpserver/gets_spec.rb
|
350
|
-
- spec/tcpserver/listen_spec.rb
|
351
|
-
- spec/tcpserver/new_spec.rb
|
352
|
-
- spec/tcpserver/output_spec.rb
|
353
|
-
- spec/tcpserver/readpartial_spec.rb
|
354
|
-
- spec/tcpserver/sysaccept_spec.rb
|
355
|
-
- spec/tcpsocket/gethostbyname_spec.rb
|
356
|
-
- spec/tcpsocket/new_spec.rb
|
357
|
-
- spec/tcpsocket/open_spec.rb
|
358
|
-
- spec/tcpsocket/partially_closable_spec.rb
|
359
|
-
- spec/tcpsocket/recv_nonblock_spec.rb
|
360
|
-
- spec/tcpsocket/setsockopt_spec.rb
|
361
|
-
- spec/tcpsocket/shared/new.rb
|
362
|
-
- spec/udpsocket/bind_spec.rb
|
363
|
-
- spec/udpsocket/connect_spec.rb
|
364
|
-
- spec/udpsocket/new_spec.rb
|
365
|
-
- spec/udpsocket/open_spec.rb
|
366
|
-
- spec/udpsocket/recvfrom_nonblock_spec.rb
|
367
|
-
- spec/udpsocket/send_spec.rb
|
368
|
-
- spec/unixserver/accept_nonblock_spec.rb
|
369
|
-
- spec/unixserver/accept_spec.rb
|
370
|
-
- spec/unixserver/for_fd_spec.rb
|
371
|
-
- spec/unixserver/new_spec.rb
|
372
|
-
- spec/unixserver/open_spec.rb
|
373
|
-
- spec/unixserver/shared/new.rb
|
374
|
-
- spec/unixsocket/addr_spec.rb
|
375
|
-
- spec/unixsocket/new_spec.rb
|
376
|
-
- spec/unixsocket/open_spec.rb
|
377
|
-
- spec/unixsocket/pair_spec.rb
|
378
|
-
- spec/unixsocket/partially_closable_spec.rb
|
379
|
-
- spec/unixsocket/path_spec.rb
|
380
|
-
- spec/unixsocket/peeraddr_spec.rb
|
381
|
-
- spec/unixsocket/recv_io_spec.rb
|
382
|
-
- spec/unixsocket/recvfrom_spec.rb
|
383
|
-
- spec/unixsocket/send_io_spec.rb
|
384
|
-
- spec/unixsocket/shared/new.rb
|
168
|
+
summary: Socket standard library for Rubinius.
|
169
|
+
test_files: []
|
385
170
|
has_rdoc:
|