Package sulley :: Module pedrpc :: Class client
[show private | hide private]
[frames | no frames]

Class client


Method Summary
  __init__(self, host, port)
Lambda __getattr__(self, method_name)
This routine is called by default when a requested attribute (or method) is accessed that has no definition.
  __connect(self)
Connect to the PED-RPC server.
  __debug(self, msg)
  __disconnect(self)
Ensure the socket is torn down.
Mixed __method_missing(self, method_name, *args, **kwargs)
See the notes for __getattr__ for related notes.
Mixed __pickle_recv(self)
This routine is used for marshaling arbitrary data from the PyDbg server.
  __pickle_send(self, data)
This routine is used for marshaling arbitrary data to the PyDbg server.

Method Details

__getattr__(self, method_name)
(Qualification operator)

This routine is called by default when a requested attribute (or method) is accessed that has no definition. Unfortunately __getattr__ only passes the requested method name and not the arguments. So we extend the functionality with a little lambda magic to the routine method_missing(). Which is actually how Ruby handles missing methods by default ... with arguments. Now we are just as cool as Ruby.
Parameters:
method_name - The name of the requested and undefined attribute (or method in our case).
           (type=String)
Returns:
Lambda magic passing control (and in turn the arguments we want) to self.method_missing().
           (type=Lambda)

__connect(self)

Connect to the PED-RPC server.

__disconnect(self)

Ensure the socket is torn down.

__method_missing(self, method_name, *args, **kwargs)

See the notes for __getattr__ for related notes. This method is called, in the Ruby fashion, with the method name and arguments for any requested but undefined class method.
Parameters:
method_name - The name of the requested and undefined attribute (or method in our case).
           (type=String)
Returns:
Return value of the mirrored method.
           (type=Mixed)

__pickle_recv(self)

This routine is used for marshaling arbitrary data from the PyDbg server. We can send pretty much anything here. For example a tuple containing integers, strings, arbitrary objects and structures. Our "protocol" is a simple length-value protocol where each datagram is prefixed by a 4-byte length of the data to be received.
Returns:
Whatever is received over the socket.
           (type=Mixed)
Raises:
pdx - An exception is raised if the connection was severed.

__pickle_send(self, data)

This routine is used for marshaling arbitrary data to the PyDbg server. We can send pretty much anything here. For example a tuple containing integers, strings, arbitrary objects and structures. Our "protocol" is a simple length-value protocol where each datagram is prefixed by a 4-byte length of the data to be received.
Parameters:
data - Data to marshal and transmit. Data can *pretty much* contain anything you throw at it.
           (type=Mixed)
Raises:
pdx - An exception is raised if the connection was severed.

Generated by Epydoc 2.1 on Fri Jul 27 17:40:03 2007 http://epydoc.sf.net