Class: EventMachine::EvmaUNIXClient
Instance Attribute Summary
Attributes inherited from Selectable
#io, #is_server, #uuid
Class Method Summary
collapse
Instance Method Summary
collapse
#eventable_read, #get_outbound_data_size, #get_peername, #heartbeat, #send_data
Methods inherited from Selectable
#close_scheduled?, #get_peername, #heartbeat, #schedule_close, #set_inactivity_timeout
Constructor Details
Returns a new instance of EvmaUNIXClient.
983
984
985
986
|
# File 'lib/em/pure_ruby.rb', line 983
def initialize io
super
@pending = true
end
|
Class Method Details
.connect(chain) ⇒ Object
971
972
973
974
975
976
977
978
979
980
|
# File 'lib/em/pure_ruby.rb', line 971
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
997
998
999
1000
1001
1002
1003
1004
1005
1006
|
# File 'lib/em/pure_ruby.rb', line 997
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
993
994
995
|
# File 'lib/em/pure_ruby.rb', line 993
def select_for_reading?
@pending ? false : super
end
|
#select_for_writing? ⇒ Boolean
989
990
991
|
# File 'lib/em/pure_ruby.rb', line 989
def select_for_writing?
@pending ? true : super
end
|