#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-

import kaa.rpc, time

@kaa.rpc.expose('ping')
def ping(name):
    return 'Hello %s, time is %s' % (name, time.strftime('%H:%M:%S'))

class Foo(object):

   @kaa.rpc.expose('func1')
   def foo(self):
       return 1

   @kaa.rpc.expose('func2')
   def bar(self):
       return 2

myaddr = '127.0.0.1'
rpc = kaa.rpc.Server((myaddr, 5000), 'very_secret')
rpc.connect(ping)
rpc.connect(Foo())
kaa.main()

