Glacier2 and Python

in Help Center
Hi everyone
For the paste couple of days, I have been trying to make a connection to a Ice server behind a Glacier2 router.
I have successfully done this in PHP, but now I am trying to get this to work in Python with no luck, I have looked at the python + glacier2 demos, but not with much luck.
Currently I have this code, but it gives me an "Ice.ConnectionRefusedException" error when I try it.
From my logic I am missing something in between, since when I used Ice on PHP, I had to define the router on every connection. But from the python demo, there is none on the Client, at least not from what I can see.
Any suggestions?
For the paste couple of days, I have been trying to make a connection to a Ice server behind a Glacier2 router.
I have successfully done this in PHP, but now I am trying to get this to work in Python with no luck, I have looked at the python + glacier2 demos, but not with much luck.
Currently I have this code, but it gives me an "Ice.ConnectionRefusedException" error when I try it.
import Ice, Glacier2 Ice.loadSlice('Murmur.ice') ice = Ice.initialize() import Murmur defaultRouter = ice.stringToProxy("PeberCPGlacier2/router:tcp -p 4063 -h 192.168.1.20") router = Glacier2.RouterPrx.checkedCast(defaultRouter) router.createSession('dev', 'devhest'); prx = ice.stringToProxy("Meta:tcp -p 6502 -h 127.0.0.1") meta = Murmur.MetaPrx.checkedCast(prx) meta.getVersion()
From my logic I am missing something in between, since when I used Ice on PHP, I had to define the router on every connection. But from the python demo, there is none on the Client, at least not from what I can see.
Any suggestions?
0
Comments
I recommend using a default router as this is much simpler and less error prone.
If you look at the python demo, in the client configuration file
When Ice.Default.Router property is set all proxies are routed throw the default router, i suspect that you are not setting this property, note that you can also set the router used by a proxy calling ice_router, this will return a new proxy with the router set to the proxy you passed in.
Regards,
José
sorry for the delay on the reply, but from the answers I got it working, thank you very much!