Winsock error 10053 in TIdCmdTCPServer.DoExecute

I've successfully migrated my service from ICS to Indy and I'm very happy with it.  There's just one thing that I'd like to resolve.

Depending on the command sent, the clients that connect to the service sometimes close the connection immediately after sending the command.  However, I don't want the service to automatically close the connection (TIdCommandHandler.Disconnect := True), as the client may send other commands.

When the client immediately disconnects, I'm getting a 10053 Winsock error in TIdCmdTCPServer.DoExecute when DoExecute determines it's return value based on whether the connection is still open:

{code}
  if Result and Assigned(AContext.Connection) then begin
    Result := AContext.Connection.Connected;
{code}

AContext.Connection.Connected eventually causes TIdStackBSDBase.Receive to be called, which receives the 10053 Winsock error because the client has already disconnected.

Two questions:
1) Will this cause any problems in the Indy server?

2) Is there anything that I can change in either the client or the service to prevent the issue from occurring?

It seems that the client sleep for a small amount of time between sending the command and disconnecting.  But I'd rather avoid adding this type of delay if possible.

Thanks!
0
Jon
4/23/2015 8:25:15 PM
embarcadero.delphi.winsock 1874 articles. 2 followers. Follow

2 Replies
708 Views

Similar Articles

[PageSpeed] 55

Jon wrote:

> When the client immediately disconnects, I'm getting a 10053 Winsock
> error in TIdCmdTCPServer.DoExecute when DoExecute determines it's
> return value based on whether the connection is still open:
<snip>
> AContext.Connection.Connected eventually causes TIdStackBSDBase.Receive
> to be called, which receives the 10053 Winsock error because the client
> has already disconnected.

The error means the client is not disconnecting "gracefully" on its end. 
 Or maybe the connection is passing through a firewall/router that is not 
closing its connection "gracefully" when it sees the client disconnecting. 
 Either way, it does not really matter, because the connection is still gone.

> 1) Will this cause any problems in the Indy server?

No.  If an uncaught exception is raised, the server catches it and stops 
the thread.  If Connected returns False instead, the thread stops itself. 
 Either way, the thread is no longer running, and the socket is closed.

> 2) Is there anything that I can change in either the client or the
> service to prevent the issue from occurring?

No, and there is no reason to try to prevent it, either.  It is common socket 
behavior, and Indy handles it for you.  The only annoyance would be if you 
are debugging the server and see the exception raised, but you can tell the 
debugger to ignore it.  Or if you have an OnException event handler, it will 
see the exception, but you can ignore it there, too.

-- 
Remy Lebeau (TeamB)
0
Remy
4/23/2015 8:54:50 PM
Thanks again.  Btw, I'm familiar with the PLEASE READ comment in the Indy sources.  But I wanted to follow up on this one.

My only confusion is the suggestion that the client is not closing the connection gracefully.  It is calling the method to close the socket.  However, it isn't anything to look into here, as the clients are still using ICS components.

Jon
0
Jon
4/23/2015 9:20:41 PM
Reply:

Similar Artilces:

Winsock errors / 1322 errors- Solved
All, Had this issue with the winsock 10060 errors on OES Linux. Turns out the iprint doesn't like the http_proxy variable set on the iprint server (webserver). Solution is to either 1) unset http_proxy and restart apache (disable it system wide using Yast or edit /etc/sysconfig/proxy and disable there). 2) set no_proxy to include your internal DNS domain so that the proxy isn't used for these requests Turns out mod_ipp uses curl libraries and it respects the http_proxy stuff, but gives problems with the mod_ipp stuff for some reason. This also manifests itsel...

Winsock Error
Hi, Lately I stared to get this message Title Winsock Error of_connect( ) Could Not connect to the database because the server actively rejected the connection I habe no idea what it is... not always sends the message. Any Idea SqlAnywhere 5.0 PB9 Thanks in advance Specific version and build of SQL Anywhere 5? Operating System? Lmcm wrote: > Hi, > Lately I stared to get this message > > Title Winsock Error of_connect( ) > Could Not connect to the database because the server actively rejected > the connection > > I habe no id...

Winsock error
Hi, I have been working with iprint and have been running into these winsock errors. I have read alot of posts on this regarding port 443 but in my case it works on alot of systems, but there are some that have that error. There doesn't seem to be anything obvious like only windows 2000 or only windows 98. I thought at one point that it was the subnet that the system was on, but that also proved not to be the case. If it was a port issue in my case would it not fail on all systems? Anyway any advice would be appreciated. Thanks JT James, It appears that...

Winsock errors
Hi, I sent a post a few minutes ago about a winsock error (10054). This question is how to reproduce the error! I've tried disconnecting, killing the connection by closing the client application, etc, and all I get from TServerSocket is a OnClientDisconnect event, no error. How do I generate an error message that can be displayed to the user (so I can test whether I have fixed the problem)? Thanks, Alain "Alain Dekker" <abdekker@NOSPAM.fsmail.net> wrote in message news:200538@forums.codegear.com... > This question is how to reproduce the error! I&#...

Winsock error
Why do I get a Winsock error when posting a message to GRC? My newsreader Agent shows the message as not being posted. When I DL headers the message has been posted. Any ideals? TIA! Regards, Greg Strong Greg Strong <Greg@NoSpam.net> wrote: > Why do I get a Winsock error when posting a message to GRC? > > My newsreader Agent shows the message as not being posted. When I DL > headers the message has been posted. Any ideals? TIA! Can you quote the message? -- Robert List of Lists - http://lists.gpick.com/ Eric Howe's Privacy and Security ...

Winsock errors
Hi, I'm using the Winsock application (from Topwiz Software) in a PB10 program, to send print requests from a workstation to one of our servers. On the server is another PB10 application that uses winsock to listen for the request. However, their are several error messages that result before (after several attempts) it works. Any ideas how I could track these? Another suggestion I've read about is to add the program to the firewall or anti-virus exception list. However, what would I add? The program that sends the request from the workstation or the program on the server...

Winsock
Is in posible to use Winsock in ASP.NET? and if, how? Richard You'll find better ways of communication than winsock API working with ASP.NET. Depending on your application, it will be much better to use XML web services and/or GET/POST/SOAP for transmission. I've elaborated this concept with usage of Win32 Internet Extensions (WinInet) in the following article. The Evolution of Web Services http://www.15seconds.com/Issue/021029.htm You may find companion source useful too. -Adnan Masood-Adnan MasoodMCSD.NET, MCAD.NET, MCPwww.DotNetSmith.com"Beware of bugs in the abov...

winsock
winsock What's the question? On Tue, 22 Apr 2003 06:33:36 -0400, 04/22/2003 wrote: >winsock Bruce Armstrong [TeamSybase] http://www.teamsybase.com Two new books on developing with PowerBuilder http://www.pb9books.com?source=newsgroups Need code sample? Check out CodeXchange: http://www.codexchange.sybase.com Preach the gospel at all times. If necessary, use words. - Francis of Assisi http://www.needhim.org ...

WinSock
I am having a problem with the winsock ocx. I get the connectionrequest event, but when I call the Accept method with the requestId I get an error. Any help... TIA, Jeff ...

Winsock
I have been trying to convert my Winsock nvo from PB10 to PocketBuilder 2.0.4 with the latest EBF applied. All I do is call wsastartup from the window open and wsacleanup from window close. When the program exits, I get this messagebox twice: Memory Error Freeing previously freed memory or freeing using different anchor! Generate GPF? [Yes] [No] Has anyone had any luck with Winsock? Hi Roland, we use winsock functions and all works fine. PK 2.0.4.940 Here are my function declarations: FUNCTION int htons ( uint hostshort ) LIBRARY "winsock.dll" FUNC...

Winsock
Hi, I need know how send message between two PC's con the API Windosock, please help me..!!! If you look in the ole/ocx/activex forum for PB you will see many discussions on this. Also go to codeXchange for a download from the activex area that you can use for socket communications using the activeX control socketwrench. <Clark> wrote in message news:3f5ce5b9.43aa.846930886@sybase.com... > Hi, I need know how send message between two PC's con the > API Windosock, please help me..!!! ...

Winsock
Hello I have Visual Studio .NET 2003 and i am making a program that needs the winsock so it can use sockets BUT i cant find it could someone please tell me where i can find or if Visual Studio even has one please(if you answer this please tell me where i can find it) You can use System.net.sockets.Socket. A good example is found at \Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Samples\Applications\Wintalk\ Thank you for the help julianobosco:You can use System.net.sockets.Socket. A good example is found at \Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\...

Winsock
Does anyone know if there are security holes in Winsock, or is it secure unless you screw up the implementation. Peter (Seeking basic information but not information on basic.) "Peter Offenwanger" <poffenwanger@hotmail.com> wrote in message news:9qphmg$ah6$1@news.grc.com... > Does anyone know if there are security holes in Winsock, or is it secure > unless you screw up the implementation. > Do you mean in terms of the specification or the implementation or both? > Do you mean in terms of the specification or the implementation or both? > ...

Winsock 10110 error
Trying to update drivers through iManage on W2K PC. The new drivers unpack to C:\NDPS\DRVR_TMP but then a Windows error "Winsock 10110 - Unknown error" pops up. Can anyone advise? TIA, Bill This e-mail is strictly confidential and intended solely for the person or organisation to whom addressed. If you are not the intended recipient, you should not copy it or use it for any purpose, nor disclose its contents to any other person. Please notify us immediately by e-mail if you receive this communication in error. The views expressed here are the personal views of the sen...

Web resources about - Winsock error 10053 in TIdCmdTCPServer.DoExecute - embarcadero.delphi.winsock

Resources last updated: 1/19/2016 8:41:59 AM