#!/usr/bin/env python

import random, CORBA
from _GlobalIDL__POA import Echo 

class Echo_Impl(Echo):

	def echoString(self, astring):
		outnum = random.randint(0, 100) / 100.0
		print "[server] %s -> %f" % (astring, outnum)
		return self._this(), outnum

orb = CORBA.ORB_init()
servant = Echo_Impl()
open("ior", "w").write(orb.object_to_string( servant._this() ))
poa = orb.resolve_initial_references("RootPOA")
poa.the_POAManager.activate()
orb.run()
