Class: OMF::OML::OmlSession

Inherits:
Base::LObject
  • Object
show all
Defined in:
lib/omf_oml/endpoint.rb

Overview

PRIVATE An instance of this class is created by OmlEndpoint to deal with and individual client connection (socket). An EndPoint is creating and instance and then immediately calls the run methods.

Instance Method Summary collapse

Constructor Details

#initialize(endpoint) ⇒ OmlSession

Returns a new instance of OmlSession.



94
95
96
97
98
99
# File 'lib/omf_oml/endpoint.rb', line 94

def initialize(endpoint)
  @endpoint = endpoint
  @header = {}
  @streams = []
  @on_new_stream_procs = {}
end

Instance Method Details

#[](key) ⇒ Object

Return the value for the respective @key@ in the protocol header.



90
91
92
# File 'lib/omf_oml/endpoint.rb', line 90

def [](key)
  @header[key]
end

#run(socket) ⇒ Object

This methods blocks until the peer disconnects. Each new stream is reported to the @reportProc@



104
105
106
107
# File 'lib/omf_oml/endpoint.rb', line 104

def run(socket)
  parse_header(socket)
  parse_rows(socket)
end