call_back_to_this(parent)
click to toggle source
def call_back_to_this parent
@call_back_to_this = parent
parent.post_init
end
connection_has_timed_out()
click to toggle source
def connection_has_timed_out
return if closed?
close unless closed?
@call_back_to_this.unbind
end
fail()
click to toggle source
def fail
@call_back_to_this.unbind
end
on_close()
click to toggle source
def on_close
@call_back_to_this.unbind
end
on_connect()
click to toggle source
def on_connect
@call_back_to_this.connection_completed if @call_back_to_this
end
on_connect_failed()
click to toggle source
def on_connect_failed
fail
end
on_read(data)
click to toggle source
def on_read(data)
@call_back_to_this.receive_data data
end
on_resolve_failed()
click to toggle source
def on_resolve_failed
fail
end
on_write_complete()
click to toggle source
def on_write_complete
close if @should_close_after_writing
end
should_close_after_writing()
click to toggle source
def should_close_after_writing
@should_close_after_writing = true;
end