Board index » delphi » Socket Error 10054

Socket Error 10054


2005-07-11 10:51:11 PM
delphi177
Hi,
I know that someone out there knows what this error means. I get it when
trying to connect. It says, "EidSocketError with message 'Socket Error #
10054 Connection reset by peer.'.
I'm using Indy 9.
Thanks,
Gerry
 
 

Re:Socket Error 10054

The connection with the remote computer was interupted for some reason.
Mike
"Gerry" <XXXX@XXXXX.COM>writes
Quote
Hi,

I know that someone out there knows what this error means. I get it when
trying to connect. It says, "EidSocketError with message 'Socket Error #
10054 Connection reset by peer.'.

I'm using Indy 9.

Thanks,

Gerry


 

Re:Socket Error 10054

Hello,
I have a function that checks if an application is on-line using IdTcpclient
version 10.0.0.76
The code that follows:
**************************************************************
function TForm1.fncTestNetwork(const sHost: string; const wrPort: word;
const wrTimeout: word): boolean;
var
IdTCP: TIdTCPClient;
begin
IdTCP:= TIdTCPClient.Create(nil);
IdTCP.Host:= sHost;
IdTCP.Port:= wrPort;
try
idTCP.ConnectTimeout:= wrTimeout * 1000;
IdTCP.Connect;
if IdTCP.Connected then IdTCP.Disconnect;
Result:= True;
except
on E: Exception do
begin
Result:= False;
end;
end;
IdTCP.Disconnect;
IdTCP.Free;
end;
**************************************************************
And I don't care about the error, I just want to know if it is on-line or
off-line.
But sometimes I receive a messagebox on the screen like:
Socket error # 10054
Connection reset by peer.
The problem is that this messagebox stops my application.
Is it an Indy trick?
How can I solve that?
Thanks in advance!
 

Re:Socket Error 10054

Jzlio Cesar writes:
Quote
And I don't care about the error, I just want to know if it is on-line
or off-line.
But sometimes I receive a messagebox on the screen like:

Socket error # 10054
Connection reset by peer.
If you are running the application in the IDE, by default the exception
will be shown by the IDE before your application catches it, so it may
not be a problem at all.
Ciaran
 

Re:Socket Error 10054

"Júlio Cesar" <XXXX@XXXXX.COM>writes
Quote
The code that follows:
Try this code instead:
function TForm1.fncTestNetwork(const sHost: string; const wrPort: word;
const wrTimeout: word): boolean;
begin
try
with TIdTCPClient.Create(nil) do
try
Host := sHost;
Port := wrPort;
ConnectTimeout := wrTimeout * 1000;
Connect;
finally
Free;
end;
Result := True;
except
Result := False;
end;
end;
Gambit
 

Re:Socket Error 10054

It worked :)
Thanks!!!
"Remy Lebeau (TeamB)" <XXXX@XXXXX.COM>escreveu na mensagem
Quote

"Júlio Cesar" <XXXX@XXXXX.COM>writes
news:43f6246d$XXXX@XXXXX.COM...

>The code that follows:

Try this code instead:

function TForm1.fncTestNetwork(const sHost: string; const wrPort:
word;
const wrTimeout: word): boolean;
begin
try
with TIdTCPClient.Create(nil) do
try
Host := sHost;
Port := wrPort;
ConnectTimeout := wrTimeout * 1000;
Connect;
finally
Free;
end;
Result := True;
except
Result := False;
end;
end;


Gambit