# File mrbgems/mruby-socket/mrblib/socket.rb, line 524 def initialize(path) fd = Socket._socket(Socket::AF_UNIX, Socket::SOCK_STREAM, 0) begin super(fd) Socket._bind(fd, Socket.pack_sockaddr_un(path)) self.listen(5) rescue => e IO._sysclose(fd) rescue nil raise e end if block_given? begin yield self ensure self.close rescue nil unless self.closed? end end end
# File mrbgems/mruby-socket/mrblib/socket.rb, line 544 def accept fd = self.sysaccept begin sock = UNIXSocket.for_fd(fd) rescue IO._sysclose(fd) rescue nil end sock end
# File mrbgems/mruby-socket/mrblib/socket.rb, line 554 def accept_nonblock begin self._setnonblock(true) self.accept ensure self._setnonblock(false) end end