Module: Arpie

Included in:
Protocol, ProtocolChain
Defined in:
lib/arpie/error.rb,
lib/arpie/proxy.rb,
lib/arpie/client.rb,
lib/arpie/server.rb,
lib/arpie/xmlrpc.rb,
lib/arpie/protocol.rb

Defined Under Namespace

Classes: Client, EIncomplete, ETryAgain, Endpoint, EventedClient, HTTPClientTestProtocol, HTTPServerTestProtocol, HTTPTestProtocol, MarshalProtocol, Protocol, ProtocolChain, ProxyClient, ProxyServer, RPCClient, RPCall, SeparatorProtocol, Server, ShellwordsProtocol, SizedProtocol, StreamError, XMLRPCClientProtocol, XMLRPCProtocol, XMLRPCServerProtocol, YAMLProtocol, YieldResult, ZlibProtocol

Constant Summary collapse

MTU =
1024

Instance Method Summary collapse

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.

Raises:



27
28
29
30
31
# File 'lib/arpie/error.rb', line 27

def bogon! data = nil, message = 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.

Raises:



36
37
38
# File 'lib/arpie/error.rb', line 36

def incomplete!
  raise EIncomplete, "#{self.is_a?(Class) ? self : self.class} needs more data"
end