Class: Qpid::Proton::Transport Deprecated
- Inherits:
-
Object
- Object
- Qpid::Proton::Transport
- Defined in:
- lib/core/transport.rb
Overview
all important features are available from #Connection
Constant Summary collapse
- TRACE_OFF =
Turn logging off entirely.
Cproton::PN_TRACE_OFF
- TRACE_RAW =
Log raw binary data into/out of the transport.
Cproton::PN_TRACE_RAW
- TRACE_FRM =
Log frames into/out of the transport.
Cproton::PN_TRACE_FRM
- TRACE_DRV =
Log driver related events; i.e., initialization, end of stream, etc.
Cproton::PN_TRACE_DRV
Instance Method Summary collapse
-
#bind(connection)
Binds to the given connection.
-
#close_head
Indicate that the output has closed.
-
#close_tail
Indicate that the input has reached EOS (end of stream).
-
#condition ⇒ Condition?
Transport error condition or nil if there is no error.
-
#condition=(c)
Set the error condition for the transport.
-
#connection ⇒ Connection?
Return the AMQP connection associated with the transport.
-
#initialize(impl = Cproton.pn_transport) ⇒ Transport
constructor
Creates a new transport instance.
-
#log(message)
Log a message to the transport’s logging mechanism.
-
#peek(size) ⇒ String
Returns the specified number of bytes from the transport’s buffers.
-
#pop(size)
Removes the specified number of bytes from the pending output queue following the transport’s head pointer.
-
#process(size)
Process input data following the tail pointer.
-
#push(data) ⇒ Integer
Pushes the supplied bytes into the tail of the transport.
-
#quiesced? ⇒ Boolean
Returns whether the transport has any buffered data.
-
#sasl ⇒ SASL
Create, or return existing, SSL object for the transport.
-
#set_server
Set server mode for this tranport - enables protocol detection and server-side authentication for incoming connections.
-
#ssl(domain = nil, session_details = nil) ⇒ SSL
Creates, or returns an existing, SSL object for the transport.
-
#tick(now) ⇒ Integer
Process any pending transport timer events.
-
#trace(level)
Updates the transports trace flags.
-
#unbind
Unbinds from the previous connection.
Constructor Details
#initialize(impl = Cproton.pn_transport) ⇒ Transport
Creates a new transport instance.
171 172 173 174 175 |
# File 'lib/core/transport.rb', line 171 def initialize(impl = Cproton.pn_transport) @impl = impl @ssl = nil self.class.store_instance(self, :pn_transport_attachments) end |
Instance Method Details
#bind(connection)
Binds to the given connection.
204 205 206 |
# File 'lib/core/transport.rb', line 204 def bind(connection) Cproton.pn_transport_bind(@impl, connection.impl) end |
#close_head
Indicate that the output has closed.
Tells the transport that no more output will be popped.
311 312 313 |
# File 'lib/core/transport.rb', line 311 def close_head Cproton.pn_transport_close_head(@impl) end |
#close_tail
Indicate that the input has reached EOS (end of stream).
This tells the transport that no more input will be forthcoming.
277 278 279 |
# File 'lib/core/transport.rb', line 277 def close_tail Cproton.pn_transport_close_tail(@impl) end |
#condition ⇒ Condition?
Returns transport error condition or nil if there is no error.
190 191 192 |
# File 'lib/core/transport.rb', line 190 def condition Condition.convert(Cproton.pn_transport_condition(@impl)) end |
#condition=(c)
Set the error condition for the transport.
196 197 198 |
# File 'lib/core/transport.rb', line 196 def condition=(c) Condition.assign(Cproton.pn_transport_condition(@impl), c) end |
#connection ⇒ Connection?
Return the AMQP connection associated with the transport.
231 232 233 |
# File 'lib/core/transport.rb', line 231 def connection Connection.wrap(Cproton.pn_transport_connection(@impl)) end |
#log(message)
Log a message to the transport’s logging mechanism.
This can be using in a debugging scenario as the message will be prepended with the transport’s identifier.
242 243 244 |
# File 'lib/core/transport.rb', line 242 def log() Cproton.pn_transport_log(@impl, ) end |
#peek(size) ⇒ String
Returns the specified number of bytes from the transport’s buffers.
289 290 291 292 293 294 |
# File 'lib/core/transport.rb', line 289 def peek(size) cd, out = Cproton.pn_transport_peek(@impl, size) return nil if cd == Qpid::Proton::Error::EOS raise TransportError.new if cd < -1 out end |
#pop(size)
Removes the specified number of bytes from the pending output queue following the transport’s head pointer.
301 302 303 |
# File 'lib/core/transport.rb', line 301 def pop(size) Cproton.pn_transport_pop(@impl, size) end |
#process(size)
Process input data following the tail pointer.
Calling this function will cause the transport to consume the specified number of bytes of input occupying the free space following the tail pointer. It may also change the value for #tail, as well as the amount of free space reported by #capacity.
267 268 269 |
# File 'lib/core/transport.rb', line 267 def process(size) Cproton.pn_transport_process(@impl, size) end |
#push(data) ⇒ Integer
Pushes the supplied bytes into the tail of the transport.
252 253 254 |
# File 'lib/core/transport.rb', line 252 def push(data) Cproton.pn_transport_push(@impl, data, data.length) end |
#quiesced? ⇒ Boolean
Returns whether the transport has any buffered data.
185 186 187 |
# File 'lib/core/transport.rb', line 185 def quiesced? Cproton.pn_transport_quiesced(@impl) end |
#sasl ⇒ SASL
Create, or return existing, SSL object for the transport.
336 337 338 |
# File 'lib/core/transport.rb', line 336 def sasl SASL.new(self) end |
#set_server
Set server mode for this tranport - enables protocol detection and server-side authentication for incoming connections
179 |
# File 'lib/core/transport.rb', line 179 def set_server() Cproton.pn_transport_set_server(@impl); end |
#ssl(domain = nil, session_details = nil) ⇒ SSL
Creates, or returns an existing, SSL object for the transport.
347 348 349 |
# File 'lib/core/transport.rb', line 347 def ssl(domain = nil, session_details = nil) @ssl ||= SSL.create(self, domain, session_details) end |
#tick(now) ⇒ Integer
Process any pending transport timer events.
This method should be called after all pending input has been processed by the transport (see #input), and before generating output (see #output).
It returns the deadline for the next pending timer event, if any art present.
330 331 332 |
# File 'lib/core/transport.rb', line 330 def tick(now) Cproton.pn_transport_tick(@impl, now) end |
#trace(level)
Updates the transports trace flags.
223 224 225 |
# File 'lib/core/transport.rb', line 223 def trace(level) Cproton.pn_transport_trace(@impl, level) end |
#unbind
Unbinds from the previous connection.
210 211 212 |
# File 'lib/core/transport.rb', line 210 def unbind Cproton.pn_transport_unbind(@impl) end |