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
156
157
158
159
160
161
162
163
|
# File 'lib/revem.rb', line 156
def self.connect *args
a = super *args
a
end
|
Instance Method Details
#call_back_to_this(parent) ⇒ Object
113
114
115
116
|
# File 'lib/revem.rb', line 113
def call_back_to_this parent
@call_back_to_this = parent
parent.post_init
end
|
#connection_has_timed_out ⇒ Object
123
124
125
126
127
|
# File 'lib/revem.rb', line 123
def connection_has_timed_out
return if closed?
close unless closed? @call_back_to_this.unbind
end
|
#fail ⇒ Object
151
152
153
154
|
# File 'lib/revem.rb', line 151
def fail
@call_back_to_this.unbind
end
|
#on_close ⇒ Object
135
136
137
|
# File 'lib/revem.rb', line 135
def on_close
@call_back_to_this.unbind end
|
#on_connect ⇒ Object
118
119
120
121
|
# File 'lib/revem.rb', line 118
def on_connect
@call_back_to_this.connection_completed if @call_back_to_this end
|
#on_connect_failed ⇒ Object
143
144
145
|
# File 'lib/revem.rb', line 143
def on_connect_failed
fail
end
|
#on_read(data) ⇒ Object
147
148
149
|
# File 'lib/revem.rb', line 147
def on_read(data)
@call_back_to_this.receive_data data
end
|
#on_resolve_failed ⇒ Object
139
140
141
|
# File 'lib/revem.rb', line 139
def on_resolve_failed
fail
end
|
#on_write_complete ⇒ Object
129
|
# File 'lib/revem.rb', line 129
def on_write_complete; close if @should_close_after_writing; end
|
#should_close_after_writing ⇒ Object
131
132
133
|
# File 'lib/revem.rb', line 131
def should_close_after_writing
@should_close_after_writing = true;
end
|