Module: Arpie
- Included in:
- Binary, BinaryType, Protocol, ProtocolChain
- Defined in:
- lib/arpie/em.rb,
lib/arpie/error.rb,
lib/arpie/binary.rb,
lib/arpie/version.rb,
lib/arpie/protocol.rb,
lib/arpie/binary_types.rb,
lib/arpie/binary/list_type.rb,
lib/arpie/binary/pack_type.rb,
lib/arpie/binary/bytes_type.rb,
lib/arpie/binary/fixed_type.rb
Defined Under Namespace
Modules: EventMachine Classes: Binary, BinaryType, BitBinaryType, BytesBinaryType, EIncomplete, FixedBinaryType, ListBinaryType, MarshalProtocol, PackBinaryType, Protocol, ProtocolChain, SeparatorProtocol, ShellwordsProtocol, SizedProtocol, StreamError, YAMLProtocol, ZlibProtocol
Constant Summary collapse
- VERSION =
"0.1.0"- MTU =
1024
Instance Method Summary collapse
-
#bogon!(data = nil, message = nil) ⇒ Object
Call this if you think the stream has been corrupted, or non-protocol data arrived.
-
#incomplete! ⇒ Object
Tell the caller that the given chunk of data is not enough to construct a whole message.
Instance Method Details
#bogon!(data = nil, message = nil) ⇒ Object
Call this if you think the stream has been corrupted, or non-protocol data arrived. message is the text to display. data is the optional misbehaving data for printing. This breaks out of the caller.
25 26 27 28 29 |
# File 'lib/arpie/error.rb', line 25 def bogon! data = nil, = nil raise StreamError, "#{self.is_a?(Class) ? self.to_s : self.class.to_s}:" + " BOGON#{data.nil? ? "" : " " + data.inspect}" + "#{message.nil? ? "" : " -- #{message}" }" end |
#incomplete! ⇒ Object
Tell the caller that the given chunk of data is not enough to construct a whole message. This breaks out of the caller.
34 35 36 |
# File 'lib/arpie/error.rb', line 34 def incomplete! raise EIncomplete, "#{self.is_a?(Class) ? self : self.class} needs more data" end |