Class: EventMachine::CallsBackToEM
Defined Under Namespace
Classes: ConnectTimer
Constant Summary
Constants inherited
from Rev::IO
Rev::IO::INPUT_SIZE
Instance Attribute Summary
#address_family, #remote_addr, #remote_host, #remote_port
Class Method Summary
collapse
Instance Method Summary
collapse
#initialize, #peeraddr, precreate
Methods inherited from Rev::Socket
#attach
Methods inherited from Rev::IO
#attach, #attached?, #close, #closed?, #detach, #disable, #enable, #enabled?, #evloop, #initialize, #output_buffer_size, #write
Methods included from Rev::Meta
#event_callback, #watcher_delegate
Constructor Details
This class inherits a constructor from Rev::TCPSocket
Class Method Details
.connect(*args) ⇒ Object
171
172
173
174
175
176
177
178
|
# File 'lib/revem.rb', line 171
def self.connect *args
a = super *args
a
end
|
Instance Method Details
#call_back_to_this(parent) ⇒ Object
128
129
130
131
|
# File 'lib/revem.rb', line 128
def call_back_to_this parent
@call_back_to_this = parent
parent.post_init
end
|
#connection_has_timed_out ⇒ Object
138
139
140
141
142
|
# File 'lib/revem.rb', line 138
def connection_has_timed_out
return if closed?
close unless closed? @call_back_to_this.unbind
end
|
#fail ⇒ Object
166
167
168
169
|
# File 'lib/revem.rb', line 166
def fail
@call_back_to_this.unbind
end
|
#on_close ⇒ Object
150
151
152
|
# File 'lib/revem.rb', line 150
def on_close
@call_back_to_this.unbind end
|
#on_connect ⇒ Object
133
134
135
136
|
# File 'lib/revem.rb', line 133
def on_connect
@call_back_to_this.connection_completed if @call_back_to_this end
|
#on_connect_failed ⇒ Object
158
159
160
|
# File 'lib/revem.rb', line 158
def on_connect_failed
fail
end
|
#on_read(data) ⇒ Object
162
163
164
|
# File 'lib/revem.rb', line 162
def on_read(data)
@call_back_to_this.receive_data data
end
|
#on_resolve_failed ⇒ Object
154
155
156
|
# File 'lib/revem.rb', line 154
def on_resolve_failed
fail
end
|
#on_write_complete ⇒ Object
144
|
# File 'lib/revem.rb', line 144
def on_write_complete; close if @should_close_after_writing; end
|
#should_close_after_writing ⇒ Object
146
147
148
|
# File 'lib/revem.rb', line 146
def should_close_after_writing
@should_close_after_writing = true;
end
|