🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

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

#3828
From: Daniel Stevenson
Date: Wed, 01 Jun 2005 04:02
38 lines
2447 bytes
> Where did you get 1110 from?  Socket errors are always 5 digits.  That
looks
> more like a Win32 API error code (1110 = ERROR_MEDIA_CHANGED)

Good observation, the code I have been using is...

void __fastcall TMyfrm::ClientSocketError(TObject *Sender,
      TCustomWinSocket *Socket, TErrorEvent ErrorEvent, int &ErrorCode)
{
  AnsiString ErrorString = GetSockError(ErrorCode);
  StatusBar->Panels->Items[1]->Text = ErrorString;
  ErrorCode = 0;   //stop exception from being thrown
}

//ClientSocket is a TClientSocket component

AnsiString __fastcall TMyfrm::GetSockError(int code)
{
  switch (code)
  {
    case 10004: return "A blocking operation was interrupted by a call to
WSACancelBlockingCall.";
    case 10009: return "The file handle supplied is not valid.";
    //case values 1010 to 11028 removed due to space
    case 11029: return "An invalid shape discard mode object was found in
the QOS provider specific buffer.";
    case 11030: return "An invalid shaping rate object was found in the QOS
provider-specific buffer.";
    case 11031: return "A reserved policy element was found in the QOS
provider-specific buffer.";
    default :
      return "!! Unknown Socket Error " + AnsiString(code);
  }
}

The exact text of the return value from the call to GetSockError is "!!
Unknown Socket Error 1110" which indicates the socket is returning a 4 digit
value.
Technical Details
Message-ID: <429d3355$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!solnet.ch!solnet.ch!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <429bfb58@newsgroups.borland.com> <429c1ee7$1@newsgroups.borland.com> <429d0ab2@newsgroups.borland.com> <429d0c25@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>
Subject: Re: Socket problems between application and service application when service installed under local system account
Date: Wed, 1 Jun 2005 14:02:30 +1000
Lines: 41
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: <429d3355$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1117598549 202.174.233.53 (31 May 2005 21:02:29 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!solnet.ch!solnet.ch!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail