summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-socket
diff options
context:
space:
mode:
authorTakeshi Watanabe <[email protected]>2017-12-09 18:44:58 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2017-12-14 00:05:23 +0900
commitd2163d13a8b7ab182787c799e9158ff71426508c (patch)
tree141f4b5d40d01b089e6f85579326d541999b67f8 /mrbgems/mruby-socket
parent949bf6ca4306125b0ba51d8b09a1f4d642c24753 (diff)
downloadmruby-d2163d13a8b7ab182787c799e9158ff71426508c.tar.gz
mruby-d2163d13a8b7ab182787c799e9158ff71426508c.zip
Declare super class in socket.rb.
Diffstat (limited to 'mrbgems/mruby-socket')
-rw-r--r--mrbgems/mruby-socket/mrblib/socket.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/mrbgems/mruby-socket/mrblib/socket.rb b/mrbgems/mruby-socket/mrblib/socket.rb
index d817300c6..70785363a 100644
--- a/mrbgems/mruby-socket/mrblib/socket.rb
+++ b/mrbgems/mruby-socket/mrblib/socket.rb
@@ -165,7 +165,7 @@ class Addrinfo
end
end
-class BasicSocket
+class BasicSocket < IO
@@do_not_reverse_lookup = true
def self.do_not_reverse_lookup
@@ -208,7 +208,7 @@ class BasicSocket
attr_accessor :do_not_reverse_lookup
end
-class IPSocket
+class IPSocket < BasicSocket
def self.getaddress(host)
Addrinfo.ip(host).ip_address
end
@@ -227,7 +227,7 @@ class IPSocket
end
end
-class TCPSocket
+class TCPSocket < IPSocket
def initialize(host, service, local_host=nil, local_service=nil)
if @init_with_fd
super(host, service)
@@ -264,7 +264,7 @@ class TCPSocket
#def self.gethostbyname(host)
end
-class TCPServer
+class TCPServer < TCPSocket
def initialize(host=nil, service)
ai = Addrinfo.getaddrinfo(host, service, nil, nil, nil, Socket::AI_PASSIVE)[0]
@init_with_fd = true
@@ -306,7 +306,7 @@ class TCPServer
end
end
-class UDPSocket
+class UDPSocket < IPSocket
def initialize(af=Socket::AF_INET)
super(Socket._socket(af, Socket::SOCK_DGRAM, 0), "r+")
@af = af
@@ -350,7 +350,7 @@ class UDPSocket
end
end
-class Socket
+class Socket < BasicSocket
def initialize(domain, type, protocol=0)
super(Socket._socket(domain, type, protocol), "r+")
end