🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.socket
Article #3829

Re: Socket problems between application and service application when service installed under local system account

#3829
From: Daniel Stevenson
Date: Wed, 01 Jun 2005 05:39
41 lines
3133 bytes
It looks as though I have 'fixed' it, I'm not sure that 'fix' is the right
word because what I did should not have made a difference to the problem we
have been exploring, let me try to explain...

Previous to opening the socket connection within the Application I perform
the following:

1 - I retrieve settings from an INI file; if not present than I use default
settings (both settings are the same so not having the INI shouldn't have
made a difference); I initially didn't use a INI file and relied upon the
default values.

2 - I checked whether the service was present in the SCManager using
OpenSCManager() and OpenService(); this was found to be present

3 - I then started the service using OpenSCManager() and  OpenService() and
ControlService() to interrogate the state of the service, if the service is
running I than am able to attempt to open Socket connection; service was
found to be running.

4 - I then attempt to open the socket connection; which previously was
causing error 1110???

My fix was to have installshield create the INI file during installation.
Although steps 1 to 3 were returning valid results, it failed for some
reason when using defaulted values (ini not present) and worked when using
an pre-existing INI file even though the values seen through debugging were
identical.

And to really confuse the issue, it worked when I manually installed the
service AND still didn't have pre-existing INI file (therefore was
sucessfull when using the default values)


I think I must have been doing something wrong, but even though it is
working and I know how to make it work, I still can't figure out why it
worked, and now I think I have 'blinking cursor fever' from looking at this
screen too long and am officially giving up in attempting to understand this
any further.

Thanks for your help.
Technical Details
Message-ID: <429d4a14@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!feeder.enertel.nl!nntpfeed-01.ops.asmr-01.energis-idc.net!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!border1.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: <429bfb58@newsgroups.borland.com> <429c1ee7$1@newsgroups.borland.com> <429d0ab2@newsgroups.borland.com> <429d0c25@newsgroups.borland.com> <429d3355$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,18a7896b72b8d882
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Daniel Stevenson" <daniel@ocreage.com.au>
Newsgroups: borland.public.cppbuilder.internet.socket
References: <429bfb58@newsgroups.borland.com> <429c1ee7$1@newsgroups.borland.com> <429d0ab2@newsgroups.borland.com> <429d0c25@newsgroups.borland.com> <429d3355$1@newsgroups.borland.com>
Subject: Re: Socket problems between application and service application when service installed under local system account
Date: Wed, 1 Jun 2005 15:39:33 +1000
Lines: 43
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 202.174.233.53
Message-ID: <429d4a14@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1117604372 202.174.233.53 (31 May 2005 22:39:32 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!feeder.enertel.nl!nntpfeed-01.ops.asmr-01.energis-idc.net!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!border1.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