Commit d2163d13 authored by Takeshi Watanabe's avatar Takeshi Watanabe Committed by Yukihiro "Matz" Matsumoto

Declare super class in socket.rb.

parent 949bf6ca
...@@ -165,7 +165,7 @@ class Addrinfo ...@@ -165,7 +165,7 @@ class Addrinfo
end end
end end
class BasicSocket class BasicSocket < IO
@@do_not_reverse_lookup = true @@do_not_reverse_lookup = true
def self.do_not_reverse_lookup def self.do_not_reverse_lookup
...@@ -208,7 +208,7 @@ class BasicSocket ...@@ -208,7 +208,7 @@ class BasicSocket
attr_accessor :do_not_reverse_lookup attr_accessor :do_not_reverse_lookup
end end
class IPSocket class IPSocket < BasicSocket
def self.getaddress(host) def self.getaddress(host)
Addrinfo.ip(host).ip_address Addrinfo.ip(host).ip_address
end end
...@@ -227,7 +227,7 @@ class IPSocket ...@@ -227,7 +227,7 @@ class IPSocket
end end
end end
class TCPSocket class TCPSocket < IPSocket
def initialize(host, service, local_host=nil, local_service=nil) def initialize(host, service, local_host=nil, local_service=nil)
if @init_with_fd if @init_with_fd
super(host, service) super(host, service)
...@@ -264,7 +264,7 @@ class TCPSocket ...@@ -264,7 +264,7 @@ class TCPSocket
#def self.gethostbyname(host) #def self.gethostbyname(host)
end end
class TCPServer class TCPServer < TCPSocket
def initialize(host=nil, service) def initialize(host=nil, service)
ai = Addrinfo.getaddrinfo(host, service, nil, nil, nil, Socket::AI_PASSIVE)[0] ai = Addrinfo.getaddrinfo(host, service, nil, nil, nil, Socket::AI_PASSIVE)[0]
@init_with_fd = true @init_with_fd = true
...@@ -306,7 +306,7 @@ class TCPServer ...@@ -306,7 +306,7 @@ class TCPServer
end end
end end
class UDPSocket class UDPSocket < IPSocket
def initialize(af=Socket::AF_INET) def initialize(af=Socket::AF_INET)
super(Socket._socket(af, Socket::SOCK_DGRAM, 0), "r+") super(Socket._socket(af, Socket::SOCK_DGRAM, 0), "r+")
@af = af @af = af
...@@ -350,7 +350,7 @@ class UDPSocket ...@@ -350,7 +350,7 @@ class UDPSocket
end end
end end
class Socket class Socket < BasicSocket
def initialize(domain, type, protocol=0) def initialize(domain, type, protocol=0)
super(Socket._socket(domain, type, protocol), "r+") super(Socket._socket(domain, type, protocol), "r+")
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment