Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

EIdSocketError Socket Error # 10054 Connection reset by peer

4,131 views
Skip to first unread message

Venu

unread,
Mar 26, 2008, 8:53:12 AM3/26/08
to
Hi,


EIdSocketError Socket Error # 10054 Connection reset by peer

I am getting this exception in only few machines of my program where I am
using TIdHTTPServer component.

Could anyone help me out on this ?

Thanks


Venu


Remy Lebeau (TeamB)

unread,
Mar 26, 2008, 12:46:19 PM3/26/08
to

"Venu" <ve...@hotmail.com> wrote in message
news:47ea...@newsgroups.borland.com...

> EIdSocketError Socket Error # 10054 Connection reset by peer

That error means the other party closed the connection ungracefully, such as
by rebotting the machine.

> I am getting this exception in only few machines of my program
> where I am using TIdHTTPServer component.

Then don't worry about it. If a client is disconnecting while TIdHTTPServer
is reading/writing from/to it, then TIdHTTPServer will handle the socket
error internally for you.


Gambit


Venu

unread,
Mar 26, 2008, 11:46:46 PM3/26/08
to
The Server and client is in the same application, infact in the same form.

I am still getting this error

"Remy Lebeau (TeamB)" <no....@no.spam.com> wrote in message
news:47ea7dde$1...@newsgroups.borland.com...

Remy Lebeau (TeamB)

unread,
Mar 27, 2008, 3:03:44 AM3/27/08
to

"Venu" <ve...@hotmail.com> wrote in message
news:47eb...@newsgroups.borland.com...

> The Server and client is in the same application, infact in the same form.

Then your OS is likely messed up. It should not be possible to get that
particular error on the same machine.

> I am still getting this error

What does your actual code look like? Where are are seeing the error
exactly - client-side or server-side? What are you doing when the error
occurs?


Gambit


Venu

unread,
Mar 27, 2008, 4:47:08 AM3/27/08
to
I am following the example
http://www.delphi3000.com/article.asp?ID=3081

On "TfrmServer.httpServerCommandGet" I am doing the page processing.

At one instance, I need to run an external function (which takes 5-7 secs)
to do some database processing and
I have to show the corresponding error page.

During this time, it comes up with an access violation with the


"EIdSocketError Socket Error # 10054 Connection reset by peer"

The call trace looks like this

:7c812a5b kernel32.RaiseException + 0x52
IdStack.TIdStack.RaiseSockError(10054)
IdTCPConnection.TIdTCPConnection.WriteBuffer((no value), 105,True)
IdTCPConnection.TIdTCPConnection.FlushWriteBuffer(-1);
IdTCPConnection.TIdTCPConnection.CloseWriteBuffer
IdCustomHTTPServer.TIdHTTPResponseInfo.WriteHeader
IdCustomHTTPServer.TIdCustomHTTPServer.DoExecute($21302E0)
IdTCPServer.IdPeerThread.Run
IdThread.TIdThread.Execute
Classes.ThreadProc($21302E0)
System.ThreadWrapper($2195610)
:7c80b683 ; C:\WINDOWS\system32\kernel32.dll

"Remy Lebeau (TeamB)" <no....@no.spam.com> wrote in message

news:47eb499b$1...@newsgroups.borland.com...

Remy Lebeau (TeamB)

unread,
Mar 27, 2008, 6:02:53 AM3/27/08
to

"Venu" <ve...@hotmail.com> wrote in message
news:47eb...@newsgroups.borland.com...

>I am following the example
> http://www.delphi3000.com/article.asp?ID=3081

That article is quite old (2005).

> On "TfrmServer.httpServerCommandGet" I am doing the page processing.

That code is not thread-safe. And much of its logic is redundant as well,
as it is duplicating logic that TIdHTTPServer natively implements
internally.

> At one instance, I need to run an external function (which takes
> 5-7 secs) to do some database processing and I have to show
> the corresponding error page.
>
> During this time, it comes up with an access violation with the
> "EIdSocketError Socket Error # 10054 Connection reset by peer"

The only way that error can occur is if the socket is being disconnected
abnormally on the client side while waiting for the server's reply. Changes
are, the client has a timeout implemented on its end, and is not closing its
socket endpoint properly.

> The call trace looks like this

You did not say which version of Indy 9 you are using. If you ave not
already done so, make sure you are using the latest Indy 9.0.50 snapshot,
and then see if the problem continues.


Gambit


Venu

unread,
Mar 28, 2008, 1:50:26 AM3/28/08
to

> The only way that error can occur is if the socket is being disconnected
> abnormally on the client side while waiting for the server's reply.
> Changes are, the client has a timeout implemented on its end, and is not
> closing its socket endpoint properly.
>

How to make the client socket connection to stay alive, I am using the
webbrowser component. Any ideas ?


Remy Lebeau (TeamB)

unread,
Mar 28, 2008, 4:29:18 AM3/28/08
to

"Venu" <ve...@hotmail.com> wrote in message
news:47ec...@newsgroups.borland.com...

> How to make the client socket connection to stay alive

There is no way to force that on the server side.

> I am using the webbrowser component.

By default, the HTTP 1.0 protocol does not use keep-alives, unless the
client explicitally asks for them. The HTTP 1.1 protocol, on the other
hand, always uses keep-alives, unless the client explicitally asks not to.
Either way, TIdHTTPServer has a KeepAlive property to support that. It is
set to False initially, so you will have to set it to True yourself. But it
is still up to the client to decide whether to use keep-alives or not.


Gambit


Venu

unread,
Mar 28, 2008, 4:43:44 AM3/28/08
to
>> How to make the client socket connection to stay alive
>
> There is no way to force that on the server side.

Is there a way to force from the client side


campo...@gmail.com

unread,
Aug 15, 2013, 12:16:41 PM8/15/13
to
0 new messages