Class: MessagePack::RPC::UNIXServerTransport
- Inherits:
-
Object
- Object
- MessagePack::RPC::UNIXServerTransport
- Defined in:
- lib/msgpack/rpc/transport/unix.rb
Defined Under Namespace
Classes: ServerSocket
Instance Method Summary collapse
-
#close ⇒ Object
ServerTransport interface.
-
#initialize(address) ⇒ UNIXServerTransport
constructor
A new instance of UNIXServerTransport.
-
#listen(server) ⇒ Object
ServerTransport interface.
Constructor Details
#initialize(address) ⇒ UNIXServerTransport
Returns a new instance of UNIXServerTransport.
118 119 120 121 |
# File 'lib/msgpack/rpc/transport/unix.rb', line 118 def initialize(address) @address = address @sock = nil end |
Instance Method Details
#close ⇒ Object
ServerTransport interface
136 137 138 139 140 |
# File 'lib/msgpack/rpc/transport/unix.rb', line 136 def close return unless @lsock @lsock.detach if @lsock.attached? @lsock.close end |
#listen(server) ⇒ Object
ServerTransport interface
124 125 126 127 128 129 130 131 132 133 |
# File 'lib/msgpack/rpc/transport/unix.rb', line 124 def listen(server) @server = server @lsock = Cool.io::UNIXServer.new(@address, ServerSocket, @server) begin @server.loop.attach(@lsock) rescue @lsock.close raise end end |