I know it seems strange but that is what is happening and the reason for this
query.
I included the simple asp code below and the CMSComm is a simple activex based
om the MSComm control.
I put a timer in the CMSComm to write a line to the log every 10 minutes and it
has been reporting for hours.
So far the only way I have found to turn it off is to restart IIS.
It is doing *exactly* what I need but being the curious type I want to know why
it is not working the way I expected which is the way you describe.
yabba
<%
dim x, temp, port, comm, wait, count
dim logPath, logName, bufferPath, bufferName
on error resume next
port = 1
session.timeout = 1
logName = "CMSComm.log"
bufferName = "cmscomm.txt"
logPath = server.mapPath("../Logs") & "\"
bufferPath = server.mapPath("../Files") & "\"
set comm = nothing
set comm = createObject("CMSComm.comm")
response.write(now & "<br>")
temp = comm.commVersion
if err <0 then
response.write "CMSComm not found<br>"
response.end
end if
response.write "CMSComm version " & temp & "<br>"
comm.setLog = logPath & logName
'call comm.clearLog()
comm.setBuffer = bufferPath & bufferName
'call comm.clearBuffer()
call comm.commClose(0)
call comm.commOpen(0, port)
session.abandon
response.end
%>
In article <#Y**************@TK2MSFTNGP04.phx.gbl>,
An*@yadayadayada.com
says...
>
"fantum" <RE*******************@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
>i would have thought as you stated but...
the process (dll) DOES launch from asp... only setting the activex object
=
>nothing in the same session stops it... session abandon does not.
More code needed since what you are saying doesn't appear to make any sense.
Take a look at this one liner:-
<%
Dim o: Set o = Server.CreateObject("MyLib.MyClass")
%>
When a request is made to this page an instance of MyLib.MyClass is created.
Now that request is finished, despite that a session has been created and
still exists, the variable o is destroyed, if it contains a reference to an
object that reference will be released.
What you seem to be saying is that this component not only is it clever
enough to spin up another thread to do the background task but is also
sensitive to whether VBScript code assigns a nothing to the variable that
received the reference as opposed to it being done automatically when the
script context is torn down.
Session.Abandon is irrelevent all that does is destroy the session object
and any of it's contents. It doesn't affect the currently running script.
>i have verified the above and the process is still running (on the server)
after several hours (verified)
Is it a seperate process that is spun up then?
>now i need to find it and stop it...
any ideas?
In article <Of**************@TK2MSFTNGP03.phx.gbl>, An*@yadayadayada.com
says...
>
"fantum" <RE*******************@hotmail.comwrote in message
news:uC**************@TK2MSFTNGP06.phx.gbl...
I have created a small activex dll to do a background task on my web
server. I
fire it off with a set myjob = server.createobject(myactivex) and it
runs.
>>
So the myactivex creates it's own thread to do the work in does it?
If not then server.createobject blocks at this point, the request never
finishes and any code following it never runs.
I do not do a set myjob = nothing and so it seems to keep working even
after
the initiating session is closed with session.abandon.
This code is probably not ever executed anyway. Avoiding set myobj =
nothing wouldn't help it would be released at the end of the request
anyway.
>Session.abandon is irrelevant.
Question... what will be the lifetime of this object and is there a way
to
>tell
if it is dead and needs to be reset... after the session is abandoned I
no
>longer have a reference to it (myjob)
Until the process in which it is created is terminated.
ASP is not a good place to be performing 'background' tasks. That's what
services are for.
TIA