Class: EventMachine::EvmaUNIXClient
Instance Attribute Summary
Attributes inherited from Selectable
#io, #uuid
Class Method Summary
collapse
Instance Method Summary
collapse
#eventable_read, #get_outbound_data_size, #get_peername, #heartbeat, #schedule_close, #send_data
Methods inherited from Selectable
#close_scheduled?, #get_peername, #heartbeat, #set_inactivity_timeout
Constructor Details
Returns a new instance of EvmaUNIXClient.
745
746
747
748
|
# File 'lib/pr_eventmachine.rb', line 745
def initialize io
super
@pending = true
end
|
Class Method Details
.connect(chain) ⇒ Object
733
734
735
736
737
738
739
740
741
742
|
# File 'lib/pr_eventmachine.rb', line 733
def self.connect chain
sd = Socket.new( Socket::AF_LOCAL, Socket::SOCK_STREAM, 0 )
begin
sd.connect_nonblock( Socket.pack_sockaddr_un( chain ))
rescue Errno::EINPROGRESS
end
EvmaUNIXClient.new sd
end
|
Instance Method Details
#eventable_write ⇒ Object
759
760
761
762
763
764
765
766
767
768
|
# File 'lib/pr_eventmachine.rb', line 759
def eventable_write
if @pending
@pending = false
if 0 == io.getsockopt(Socket::SOL_SOCKET, Socket::SO_ERROR).unpack("i").first
EventMachine::event_callback uuid, ConnectionCompleted, ""
end
else
super
end
end
|
#select_for_reading? ⇒ Boolean
755
756
757
|
# File 'lib/pr_eventmachine.rb', line 755
def select_for_reading?
@pending ? false : super
end
|
#select_for_writing? ⇒ Boolean
751
752
753
|
# File 'lib/pr_eventmachine.rb', line 751
def select_for_writing?
@pending ? true : super
end
|