Sockets, services etc.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Sockets, services etc.

Bill Schwab
Hello all,

I appear to have had success in using srvany.exe to run a deployed Dolphin
exe as a service (that part is pretty easy), and in using a few of the
service functions to create and delete the service (that wasn't so easy).
One of the more confusing parts was assigning dependencies because the
control panel is very particular about what it will display.

After getting that far, I recognized a problem: Dolphin sockets need desktop
access to work.  A possible workaround is to allow the service to interact
with the desktop and then simply hide the window.  Without hiding the
window, a quick test reveals that the service launches on reboot and is
available before any user logs in, and is available during the first user
session.  When the first user logs out, the window apparently gets
clobbered, and the sockets of the service no longer work.  The service is
still running though, so hopefully there is some kind of session message
that would allow the app to survive in tact.  Any ideas or book
recommendations?

Alternatively, how hard would it be to write an overlapped sockets mapping?
That would allow console apps to use sockets too.

Have a good one,

Bill

--
Wilhelm K. Schwab, Ph.D.
[hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: Sockets, services etc.

Steve Alan Waring
Hi Bill,

Bill Schwab wrote:

> ... When the first user logs out, the window
> apparently gets clobbered, and the sockets
> of the service no longer work.  The service is
> still running though, so hopefully there is some
> kind of session message that would allow the
> app to survive in tact.  Any ideas or book
> recommendations?

Not sure if this would cause your problem, but I have noticed that there are
situations where WinAsyncSocket's DefaultInstance can become a DeafObject.

For example, evaluate "WinAsyncSocket default" then do a Panic. If you
evaluate "WinAsyncSocket default" again, it will answer the DeafObject.

It might be worth adding a check to see what the DefaultInstance is when the
first user logs out.

Steve

--
Steve Waring
Email: [hidden email]
Journal: http://www.stevewaring.net/blog/home/index.html