On Thursday 22 August 2002 09:04 am, Juan Carlos CORUÑA wrote:
> Hi all!
> I'm trying to develope a zope object that connects to a external socket
> server in order to comunícate with it and receive some events (Maybe I
> need a thread to process events).

That's probably a good idea if not necessary if Zope must respond to incoming 
events other than over HTTP.
> The problem is how to establish the connection at the start of zope and
> to disconnect at the end. After some test assigning the socket server
> object to _v_ variables in the zope object, it missed the connection
> after a while. It seems that it can't maintain the reference stored in
> the _v_ variable.

I would recommend using module level global variables instead. Volatile vars 
are just that. If a persistent object with volatiles gets unloaded by the 
ZODB (which can happen at any time arbitrarily), its volatiles go bye bye. 

Volatiles are also thread specific. Module globals are shared across threads, 
which may be a good or bad thing depending on your situation ;^).
> I thing that the behaviour is something like database connections and
> I'm looking into some database connection objects to find out the
> mechanism used.

Yup. Except they don't receive events except in response to a request coming 
from Zope.


Zope-Dev maillist  -  [EMAIL PROTECTED]
**  No cross posts or HTML encoding!  **
(Related lists -
 http://lists.zope.org/mailman/listinfo/zope )

Reply via email to