Class: LiveConsole::IOMethods::UnixSocketConnection
- Inherits:
-
Object
- Object
- LiveConsole::IOMethods::UnixSocketConnection
- Defined in:
- lib/live_console/io_methods/unix_socket/connection.rb
Instance Attribute Summary collapse
-
#raw_input ⇒ Object
Returns the value of attribute raw_input.
-
#raw_output ⇒ Object
Returns the value of attribute raw_output.
Instance Method Summary collapse
- #authenticate ⇒ Object
-
#initialize(server, opts) ⇒ UnixSocketConnection
constructor
A new instance of UnixSocketConnection.
- #select ⇒ Object
- #start ⇒ Object
- #stop ⇒ Object
Constructor Details
#initialize(server, opts) ⇒ UnixSocketConnection
Returns a new instance of UnixSocketConnection.
7 8 9 10 |
# File 'lib/live_console/io_methods/unix_socket/connection.rb', line 7 def initialize(server, opts) @server = server @opts = opts end |
Instance Attribute Details
#raw_input ⇒ Object
Returns the value of attribute raw_input.
5 6 7 |
# File 'lib/live_console/io_methods/unix_socket/connection.rb', line 5 def raw_input @raw_input end |
#raw_output ⇒ Object
Returns the value of attribute raw_output.
5 6 7 |
# File 'lib/live_console/io_methods/unix_socket/connection.rb', line 5 def raw_output @raw_output end |
Instance Method Details
#authenticate ⇒ Object
33 34 35 |
# File 'lib/live_console/io_methods/unix_socket/connection.rb', line 33 def authenticate true end |
#select ⇒ Object
29 30 31 |
# File 'lib/live_console/io_methods/unix_socket/connection.rb', line 29 def select IO.select [@server], [], [], 1 if @server end |
#start ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/live_console/io_methods/unix_socket/connection.rb', line 12 def start begin self.raw_input = self.raw_output = @server.accept_nonblock raw_input.sync = true return true rescue Errno::EAGAIN, Errno::ECONNABORTED, Errno::EPROTO, Errno::EINTR => e select retry end end |
#stop ⇒ Object
24 25 26 27 |
# File 'lib/live_console/io_methods/unix_socket/connection.rb', line 24 def stop select raw_input.close end |