Re: Troubles with ActiveX-EXE (Out-Of-Process Server)
- From: "Tony Proctor" <tony_proctor@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 22 May 2005 10:55:52 +0100
If all the client connections are terminated properly, and the server isn't
continuing to hold references on its own objects, then the ActiveX EXE
should disappear of its own accord. I think your problem is that WantClose()
isn't being called in the 'network disconnection' case. Hence, the ActiveX
EXE's own Collection is keeping references to those objects, even though the
external references have been terminated (DCOM has an internal "ping" every
2 min, and after 3 consecutive failures, the server will understand that the
client has disappeared)
I'd recommend holding a Collection of ObjPtr() values rather than the full
object references themselves. This prevents the ActiveX EXE keeping the
reference counts from going to 0. Alternatively, if you really need to call
on these objects, try a weak reference such as the technique often called
"freeze dried" object references:
http://groups.google.ie/group/microsoft.public.vb.general.discussion/msg/d88c59bed57e120d?hl=en
Tony Proctor
"Peter" <Peter@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:E0377700-FB91-4F75-BE27-6F5EA3AB06E4@xxxxxxxxxxxxxxxx
> Sorry for this stupid text-format. Have copied from notepad. Here is the
same
> text again:
>
> I have some troubles with an ActiveX-Exe written in VB6. It is installad
on
> a Server-PC. Every Client creates one Remote-Instance on the Server with:
> CreateObject( CLASS, SRV ). Additionaly these Objectes are managed in a
> collection by the ActiveX-Exe itself. So the server is able to disconnect
the
> Clients with the following method: The Server fires the Event
"WantClose()".
> After that the Clients have to disconnect and destroy their
Remote-Instances
> (set to Nothing).
>
> That is working fine. However there are situations, where the client isn't
> able to disconnect itself (i.e. the network-connection has lost, or the
> client-application hangs). What now? The server can remove the object from
> its collection, but it can't decrement the Reference-Counter for the
Client.
> And so the Instance won't be destroyed by (D)COM.
>
> In this situation, the only way out is: Go to the Server and kill the
> process with the taskmanager. But that's unaccepteble with approximately
150
> customers. And this situation happens very often in a scenario with 15
> Clients and a Server, which is running 24 Hours, 7 Days the week. A simple
> network-break is enough to produce this memory-leak.
>
> The bottom line is now:
> Is there a possibility, to destroy these Objects without killing the
process
> manually? This is very important for us, because there are situations, we
> have to restart our Applications. And how should the User update the
> ActiveX-EXE from an Installer-Programm, when the Component is hanging?
>
>
> Thanks in advance for tipps and suggestions
> and a nice weekend,
>
> Peter
.
- References:
- Prev by Date: Re: Using USB Barcode with Visual Basic 6.0 ?
- Next by Date: Re: Using USB Barcode with Visual Basic 6.0 ?
- Previous by thread: Re: Troubles with ActiveX-EXE (Out-Of-Process Server)
- Next by thread: Using USB Barcode with Visual Basic 6.0 ?
- Index(es):
Relevant Pages
|
Loading