Class: Steep::Server::CommandSocket::Session
- Defined in:
- lib/steep/server/command_socket.rb
Overview
A connection from a CLI client
#write never raises even if the client is disconnected, because it may be called from
the master's write thread, which should keep running for other clients.
Instance Attribute Summary collapse
-
#socket ⇒ Object
readonly
Returns the value of attribute socket.
Instance Method Summary collapse
- #close ⇒ Object
-
#initialize(socket) ⇒ Session
constructor
A new instance of Session.
- #write(message) ⇒ Object
Constructor Details
Instance Attribute Details
#socket ⇒ Object (readonly)
Returns the value of attribute socket.
19 20 21 |
# File 'lib/steep/server/command_socket.rb', line 19 def socket @socket end |
Instance Method Details
#close ⇒ Object
37 38 39 40 41 42 43 44 45 46 |
# File 'lib/steep/server/command_socket.rb', line 37 def close @mutex.synchronize do @closed = true end begin @socket.close rescue IOError # Already closed end end |
#write(message) ⇒ Object
28 29 30 31 32 33 34 35 |
# File 'lib/steep/server/command_socket.rb', line 28 def write() @mutex.synchronize do return if @closed @writer.write() end rescue SystemCallError, IOError close() end |