class Qpid::Proton::Receiver
The receiving endpoint.
@see Sender
Constants
- PROTON_METHOD_PREFIX
@private
Public Instance Methods
Grants credit for incoming deliveries.
@param n [Fixnum] The amount to increment the link credit.
# File lib/core/receiver.rb, line 63 def flow(n) Cproton.pn_link_flow(@impl, n) end
Allows receiving up to the specified limit of data from the remote endpoint.
Note that large messages can be streamed across the network, so just because there is no data to read does not imply the message is complete.
To ensure the entirety of the message data has been read, either call receive until nil is returned, or verify that partial? is false and Delivery#pending is 0.
@param limit [Fixnum] The maximum bytes to receive.
@return [Fixnum, nil] The number of bytes received, or nil if the end of the stream was reached.t
@see Deliver#pending To see how much buffer space is needed.
@raise [LinkError] If an error occurs.
# File lib/core/receiver.rb, line 86 def receive(limit) (n, bytes) = Cproton.pn_link_recv(@impl, limit) return nil if n == Qpid::Proton::Error::EOS raise LinkError.new("[#{n}]: #{Cproton.pn_link_error(@impl)}") if n < 0 return bytes end