Commit b3c6075d authored by Tomoyuki Sahara's avatar Tomoyuki Sahara
parent b7440975
...@@ -223,7 +223,6 @@ end ...@@ -223,7 +223,6 @@ end
class TCPSocket class TCPSocket
def initialize(host, service, local_host=nil, local_service=nil) def initialize(host, service, local_host=nil, local_service=nil)
self._bless
if self.is_a? TCPServer if self.is_a? TCPServer
super(host, service) super(host, service)
else else
...@@ -248,7 +247,6 @@ end ...@@ -248,7 +247,6 @@ end
class TCPServer class TCPServer
def initialize(host=nil, service) def initialize(host=nil, service)
self._bless
ai = Addrinfo.getaddrinfo(host, service, nil, nil, nil, Socket::AI_PASSIVE)[0] ai = Addrinfo.getaddrinfo(host, service, nil, nil, nil, Socket::AI_PASSIVE)[0]
super(Socket._socket(ai.afamily, Socket::SOCK_STREAM, 0), "r+") super(Socket._socket(ai.afamily, Socket::SOCK_STREAM, 0), "r+")
Socket._bind(self.fileno, ai.to_sockaddr) Socket._bind(self.fileno, ai.to_sockaddr)
...@@ -281,7 +279,6 @@ end ...@@ -281,7 +279,6 @@ end
class UDPSocket class UDPSocket
def initialize(af=Socket::AF_INET) def initialize(af=Socket::AF_INET)
self._bless
super(Socket._socket(af, Socket::SOCK_DGRAM, 0), "r+") super(Socket._socket(af, Socket::SOCK_DGRAM, 0), "r+")
@af = af @af = af
self self
...@@ -326,7 +323,6 @@ end ...@@ -326,7 +323,6 @@ end
class Socket class Socket
def initialize(domain, type, protocol=0) def initialize(domain, type, protocol=0)
self._bless
super(Socket._socket(domain, type, protocol), "r+") super(Socket._socket(domain, type, protocol), "r+")
end end
...@@ -436,7 +432,6 @@ end ...@@ -436,7 +432,6 @@ end
class UNIXSocket class UNIXSocket
def initialize(path, &block) def initialize(path, &block)
self._bless
super(Socket._socket(AF_UNIX, SOCK_STREAM, 0), "r+") super(Socket._socket(AF_UNIX, SOCK_STREAM, 0), "r+")
Socket._connect(self.fileno, Socket.sockaddr_un(path)) Socket._connect(self.fileno, Socket.sockaddr_un(path))
if block if block
...@@ -479,7 +474,6 @@ end ...@@ -479,7 +474,6 @@ end
class UNIXServer class UNIXServer
def initialize(path, &block) def initialize(path, &block)
self._bless
super(Socket._socket(Socket::AF_UNIX, Socket::SOCK_STREAM, 0), "r") super(Socket._socket(Socket::AF_UNIX, Socket::SOCK_STREAM, 0), "r")
Socket._bind(self.fileno, Socket.pack_sockaddr_un(path)) Socket._bind(self.fileno, Socket.pack_sockaddr_un(path))
listen(5) listen(5)
......
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