🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #7922

Re: Controlling Windows service

#7922
From: Remy Lebeau (TeamB)
Date: Wed, 15 Dec 2004 18:22
44 lines
3380 bytes
"Deepak Mishra" <deepak.dmishra@gmail.com> wrote in message
news:41c03b9d$1@newsgroups.borland.com...

> 3) FPService will not start automatically when the OS starts ( which
> usually is not the case with the normal windows services. It will be in
> a pause mode).

Why won't it be started with the OS?  It should be.  Just don't have it
doing any actual work until requested.

> 8) I'm using TCP/IP to communicate between MyClient and MyServer
> and also to uplaod files from Machine A to Machine C, through FTPService.

Have MyServer use TCP/IP to communicate back and forth with FTPService as
well.  When MyServer accepts a new client, send a request to FTPService to
begin working.  When all clients have disconnected, send a request to
FTPService to stop working.  Using TCP/IP, MyClient can also connect to
FTPService to make its own start/stop requests directly.

There is a difference between starting/stopping the service itself, and
having the service start/stop just its internal work.  Your descriptions so
far have suggested that you are trying to do the former.  You should do the
latter instead.

> 1) How do I get to to know the name of the Machine A at design time,
> to use the "OpenSCManager". (Keeping in mind point 10 above).

You don't need it.  Just specify NULL to specify the local machine.  Don't
try to access the service object directly from remote machines.  Use TCP/IP
to communicate with the service instead.

> 2) What will be better, creating FTPService as a windows service for the
> above requirements. Or to create a separate thread or process in the
> MyServer application to do the job tobe done by FTPService.

If you can, then use threads inside MyServer.  I see no reason why it needs
to be separated into its own service/process.  Unless you want the FTP work
to be performed while MyServer is not running, but it does not sound like
you do.  MyClient is already connected to MyServer anyway, so it can send
its start/stop requests to MyServer via the connection it already has.


Gambit
Technical Details
Message-ID: <41c080b5$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!transit.nntp.hccnet.nl!transit1.nntp.hccnet.nl!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <41bd5410$1@newsgroups.borland.com> <41bd87dc$1@newsgroups.borland.com> <41bd993f$1@newsgroups.borland.com> <41bdec9b$3@newsgroups.borland.com> <41beb248$1@newsgroups.borland.com> <41bec2e7$1@newsgroups.borland.com> <41becfcf$1@newsgroups.borland.com> <rbbur018gt22husuna7agpbfessgu0nqs6@4ax.com> <41bf34ee$1@newsgroups.borland.com> <41c03b9d$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,2580bf3649196f02
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <41bd5410$1@newsgroups.borland.com> <41bd87dc$1@newsgroups.borland.com> <41bd993f$1@newsgroups.borland.com> <41bdec9b$3@newsgroups.borland.com> <41beb248$1@newsgroups.borland.com> <41bec2e7$1@newsgroups.borland.com> <41becfcf$1@newsgroups.borland.com> <rbbur018gt22husuna7agpbfessgu0nqs6@4ax.com> <41bf34ee$1@newsgroups.borland.com> <41c03b9d$1@newsgroups.borland.com>
Subject: Re: Controlling Windows service
Date: Wed, 15 Dec 2004 10:22:15 -0800
Lines: 46
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 68.69.17.41
Message-ID: <41c080b5$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1103134901 68.69.17.41 (15 Dec 2004 10:21:41 -0800)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!transit.nntp.hccnet.nl!transit1.nntp.hccnet.nl!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail