Class: ScripTTY::Net::EventLoop::SocketChannelWrapper
- Inherits:
-
Object
- Object
- ScripTTY::Net::EventLoop::SocketChannelWrapper
show all
- Defined in:
- lib/scriptty/net/event_loop.rb
Instance Method Summary
collapse
Constructor Details
522
523
524
525
|
# File 'lib/scriptty/net/event_loop.rb', line 522
def initialize(master, channel) @master = master
@channel = channel
end
|
Instance Method Details
#close ⇒ Object
527
528
529
530
|
# File 'lib/scriptty/net/event_loop.rb', line 527
def close
@master.send(:close_channel, @channel)
nil
end
|
#local_address ⇒ Object
537
538
539
|
# File 'lib/scriptty/net/event_loop.rb', line 537
def local_address
EventLoop.unparse_address(@channel.socket.getLocalSocketAddress)
end
|
#on_close(&callback) ⇒ Object
532
533
534
535
|
# File 'lib/scriptty/net/event_loop.rb', line 532
def on_close(&callback)
@master.send(:set_on_close_callback, @channel, &callback)
self
end
|