Sha256: fef6966f42df46a922e6d110ec23b062f13bbb9b0b0630f644d67799b822aceb
Contents?: true
Size: 767 Bytes
Versions: 3
Compression:
Stored size: 767 Bytes
Contents
class UNIXServer < UNIXSocket def initialize(path) @no_reverse_lookup = self.class.do_not_reverse_lookup @path = path fd = RubySL::Socket::Foreign.socket(Socket::AF_UNIX, Socket::SOCK_STREAM, 0) Errno.handle('socket(2)') if fd < 0 IO.setup(self, fd, 'r+', true) binmode sockaddr = Socket.sockaddr_un(@path) status = RubySL::Socket::Foreign.bind(descriptor, sockaddr) Errno.handle('bind(2)') if status < 0 listen(Socket::SOMAXCONN) end def listen(backlog) RubySL::Socket.listen(self, backlog) end def accept RubySL::Socket.accept(self, UNIXSocket)[0] end def accept_nonblock RubySL::Socket.accept_nonblock(self, UNIXSocket)[0] end def sysaccept accept.fileno end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
rubysl-socket-2.2.1 | lib/socket/unix_server.rb |
rubysl-socket-2.2 | lib/socket/unix_server.rb |
rubysl-socket-2.1.3 | lib/socket/unix_server.rb |