Package SPyRO :: Module SPyRO :: Class PeerConnection
[show private | hide private]
[frames | no frames]

Class PeerConnection


Connect to Remote Host and create a channel to communicate This object must be used in a synchronous way
Method Summary
  __init__(self)
  callObjectErrorHandler(self, obj, request, exception, description)
When an exception is catched while serving objects we call an special method in servers named |__spyro_error_handler__|.
  can_call(self)
  can_del(self)
  can_follow_objname(self)
  can_get(self)
  can_register(self)
  can_set(self)
  getargument(self, comm, arg)
Get the argument asociated to |arg| using the |comm| It manages references and values
  getcomm(self, serv, request)
Returns the CommunicationClient associated to the address that made the |request| through the |serv|
  handleCall(self, serv, request, obj, atr)
handles the execution of methods.
  solve_request(self, serv, rfile, wfile, environment, httprequest)
Solve one SPyRO request |serv| SPyRO Server |rfile| Read file |wfile| Write file |environment| Environment of the Request |httpserver| httpserver object

Method Details

callObjectErrorHandler(self, obj, request, exception, description)

When an exception is catched while serving objects we call an special method in servers named |__spyro_error_handler__|. This method will receive: __spyro_error_handler__(peerconnection, request, exception,description) |peerconnection| The resolver of this connection |request| The SPyRO request |exception| The exception catched |description| A description of the problem.

getargument(self, comm, arg)

Get the argument asociated to |arg| using the |comm| It manages references and values

getcomm(self, serv, request)

Returns the CommunicationClient associated to the address that made the |request| through the |serv|

handleCall(self, serv, request, obj, atr)

handles the execution of methods. called by handle. If the object has the attribute __spyro__ it must be an object with the |__contains__| method and every element is a method that must be handled by pass (call methods with the request method as the first argument, other arguments are passed as normal)

If the object has the attribute '__spyro_formats__' it must be a dictionary (object with the __getitem__ method) of { methodname: argumentformats }

Where |methodname| must be the name of methods where the arguments need to be checked |argumentformats| is the format as listed in the SPyRO.args module

solve_request(self, serv, rfile, wfile, environment, httprequest)

Solve one SPyRO request |serv| SPyRO Server |rfile| Read file |wfile| Write file |environment| Environment of the Request |httpserver| httpserver object

Generated by Epydoc 2.1 on Sat Oct 14 11:50:51 2006 http://epydoc.sf.net