Re: Pyro4.Proxy() does not check for nameserver yet?

Irmen de Jong <[email protected]> Sat, 02 Nov 2013 11:21:16 +0100
Newsgroups gmane.comp.python.pyro
Message-ID <[email protected]>
On 2-11-2013 2:57, Irmen de Jong wrote:
> On 1-11-2013 14:41, Richard van Bemmelen wrote:
>> I was trying some tests with the nameserver not yet running.
>> Apparenty putting 'try .. except' around:
>>
>> debug = Pyro4.Proxy("PYRONAME:debugserver@%s:9090" % nshost) 
>>
>> did not detect that the name server was not running.
>> That was detected when I executed the next statement:
>>
>> debug.set(..)
>>
>> so actually calling a function on the remote object.
>>
>> Is this behaviour expected?
> 
> Yes. The proxy object doesn't create a socket connection until it is actually needed,
> which is when you first start calling a method on it.
> 
> You can "force" the socket connection by calling proxy._pyroBind()
> Note that this *will* update the uri that is used bye the proxy, by the actual uri. I.e.
> you will loose the PYRONAME uri in the proxy.
> 
> 
> Irmen
> 

Right, I should not reply at that late an hour.
The better method to use is proxy._pyroReconnect() which will just connect the proxy if
it is not yet connected. It won't change the stored Uri.


Irmen


------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk