Module: Stub::Connection

Defined in:
lib/uaa/stub/server.rb

Overview


Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#req_handlerObject

Returns the value of attribute req_handler.



209
210
211
# File 'lib/uaa/stub/server.rb', line 209

def req_handler
  @req_handler
end

Instance Method Details

#receive_data(data) ⇒ Object



212
213
214
215
216
217
218
219
220
221
222
223
224
# File 'lib/uaa/stub/server.rb', line 212

def receive_data(data)
  #req_handler.server.logger.debug "got #{data.bytesize} bytes: #{data.inspect}"
  return unless req_handler.request.completed? data
  req_handler.process
  send_data req_handler.reply.to_s
  if req_handler.reply.headers['connection'] =~ /^close$/i || req_handler.server.status != :running
    close_connection_after_writing
  end
rescue Exception => e
  req_handler.server.logger.debug "exception from receive_data: #{e.message}"
  req_handler.server.trace { e.backtrace }
  close_connection
end

#unbindObject



210
# File 'lib/uaa/stub/server.rb', line 210

def unbind; req_handler.server.delete_connection(self) end