Class: EventMachine::EvmaTCPClient
Instance Attribute Summary
Attributes inherited from Selectable
#io, #uuid
Class Method Summary
collapse
Instance Method Summary
collapse
#eventable_read, #get_peername, #schedule_close, #send_data
Methods inherited from Selectable
#close_scheduled?, #get_peername
Constructor Details
Returns a new instance of EvmaTCPClient.
495
496
497
498
|
# File 'lib/pr_eventmachine.rb', line 495
def initialize io
super
@pending = true
end
|
Class Method Details
.connect(host, port) ⇒ Object
483
484
485
486
487
488
489
490
491
492
|
# File 'lib/pr_eventmachine.rb', line 483
def self.connect host, port
sd = Socket.new( Socket::AF_INET, Socket::SOCK_STREAM, 0 )
begin
sd.connect_nonblock( Socket.pack_sockaddr_in( port, host ))
rescue Errno::EINPROGRESS
end
EvmaTCPClient.new sd
end
|
Instance Method Details
#eventable_write ⇒ Object
#select_for_reading? ⇒ Boolean
505
506
507
|
# File 'lib/pr_eventmachine.rb', line 505
def select_for_reading?
@pending ? false : super
end
|
#select_for_writing? ⇒ Boolean
501
502
503
|
# File 'lib/pr_eventmachine.rb', line 501
def select_for_writing?
@pending ? true : super
end
|