Class: OMF::OML::OmlSession
- Inherits:
-
Base::LObject
- Object
- Base::LObject
- OMF::OML::OmlSession
- 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
-
#[](key) ⇒ Object
Return the value for the respective @key@ in the protocol header.
-
#initialize(endpoint) ⇒ OmlSession
constructor
A new instance of OmlSession.
-
#run(socket) ⇒ Object
This methods blocks until the peer disconnects.
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 |