Skip to content
deavid edited this page Dec 25, 2010 · 1 revision

Application Programming Interface (API)

Main module (bjsonrpc)

Provides two helper functions:

  • def server(host="127.0.0.1", port=10123, handler_factory=NullHandler) -> Returns Server Object
  • def connect(host="127.0.0.1", port=10123, handler_factory=NullHandler) -> Returns Connection Object

Handlers

Provides the basic handler, a element which holds the methods that can be called from the other end:

bjsonrpc.handlers.BaseHandler(self, connection)

You should create your own class and inherit from this type.

It comes with an empty method called "setup" that it's called after init

Server

bjsonrpc.server.Server(self, conn, handler_factory)

  • _debug_socket = False -- prints to stdout the data read and sent from socket
  • _debug_dispatch = False -- prints some errors from the client.
  • def serve(self) -- method for start daemon

Connection

bjsonrpc.connection.RemoteObject(self,conn,obj):

  • Represents a object in the other end of the line.

bjsonrpc.connection.Connection(self,socket,address, handler_factory):

  • handles all thata coming from and to the socket.
Clone this wiki locally