Module: EventMachine::Wssh::Server::Ssh
- Defined in:
- lib/em/wssh/server.rb
Instance Attribute Summary collapse
-
#req ⇒ Object
Returns the value of attribute req.
Instance Method Summary collapse
- #initialize(req) ⇒ Object
- #log(*msg) ⇒ Object
- #post_init ⇒ Object
- #receive_data(data) ⇒ Object
- #unbind ⇒ Object
Instance Attribute Details
#req ⇒ Object
Returns the value of attribute req.
31 32 33 |
# File 'lib/em/wssh/server.rb', line 31 def req @req end |
Instance Method Details
#initialize(req) ⇒ Object
33 34 35 |
# File 'lib/em/wssh/server.rb', line 33 def initialize req self.req=req end |
#log(*msg) ⇒ Object
37 38 39 |
# File 'lib/em/wssh/server.rb', line 37 def log *msg req.log *msg end |
#post_init ⇒ Object
41 42 43 44 45 46 |
# File 'lib/em/wssh/server.rb', line 41 def post_init log "Connected to SSH server" req.ssh=self req.buf.each{|data| send_data data} req.buf=nil end |
#receive_data(data) ⇒ Object
48 49 50 |
# File 'lib/em/wssh/server.rb', line 48 def receive_data data req.ws.send_binary data end |
#unbind ⇒ Object
52 53 54 55 |
# File 'lib/em/wssh/server.rb', line 52 def unbind log 'SSH server closed connection' req.bye end |