Sha256: 370e96e64c3281a67aac737f1f6de837add09ce9077f7ef2b672f43dd279fa6b

Contents?: true

Size: 647 Bytes

Versions: 12

Compression:

Stored size: 647 Bytes

Contents

require 'socket'

module Celluloid
  module IO
    # UNIXServer with combined blocking and evented support
    class UNIXServer
      extend Forwardable
      def_delegators :@server, :listen, :sysaccept, :close, :closed?

      def self.open(socket_path)
        self.new(socket_path)
      end

      def initialize(socket_path)
        @server = ::UNIXServer.new(socket_path)
      end

      def accept
        Celluloid::IO.wait_readable(@server)
        accept_nonblock
      end

      def accept_nonblock
        Celluloid::IO::UNIXSocket.new(@server.accept_nonblock)
      end

      def to_io
        @server
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
celluloid-io-0.16.5.pre0 lib/celluloid/io/unix_server.rb
celluloid-io-0.16.2 lib/celluloid/io/unix_server.rb
celluloid-io-0.16.1 lib/celluloid/io/unix_server.rb
celluloid-io-0.16.0 lib/celluloid/io/unix_server.rb
celluloid-io-0.16.0.pre2 lib/celluloid/io/unix_server.rb
celluloid-io-0.16.0.pre lib/celluloid/io/unix_server.rb
celluloid-io-0.15.0 lib/celluloid/io/unix_server.rb
celluloid-io-0.15.0.pre2 lib/celluloid/io/unix_server.rb
celluloid-io-0.15.0.pre lib/celluloid/io/unix_server.rb
celluloid-io-0.14.1 lib/celluloid/io/unix_server.rb
celluloid-io-0.14.0 lib/celluloid/io/unix_server.rb
celluloid-io-0.14.0.pre lib/celluloid/io/unix_server.rb