Discussion:
idTCPClient with hsDisconnected := true
(too old to reply)
Pera Detlic
2008-06-19 18:52:56 UTC
Permalink
Hi,

My application is using Indy almost a hole year (always the last available
version) and it works just fine, but from time to time (sometimes few times
in a day , sometimes few times in a week) I get SocketStarted := false (code
is at the end of mail).
My app. is on a few places with different computers and lan switch but the
results are the same - it works 24/7
Users just restart app. and everything work just fine - until next
hsDisconnected := true

Which parameter I can change to fix this problem ?

Thx

-------------------------------- code -----------------------------

procedure TGlavniF.TCPClientSocketStatus(ASender: TObject;
const AStatus: TIdStatus; const AStatusText: String);
begin

if AStatus = hsConnected then
begin
SocketStarted := true;
end;

if AStatus = hsDisconnected then
begin
SocketStarted := false;
end;

end;
Remy Lebeau (TeamB)
2008-06-19 19:40:06 UTC
Permalink
Post by Pera Detlic
My application is using Indy almost a hole year (always the last
available version) and it works just fine, but from time to time
(sometimes few times in a day , sometimes few times in a week)
I get SocketStarted := false (code is at the end of mail).
Well, clearly the connection is being disconnected somewhere in order for
that to happen. If you are not calling Disconnect() on your end, then the
server is closing the connection on its end instead.


Gambit
Pera Detlic
2008-06-20 17:27:25 UTC
Permalink
Post by Remy Lebeau (TeamB)
Post by Pera Detlic
My application is using Indy almost a hole year (always the last
available version) and it works just fine, but from time to time
(sometimes few times in a day , sometimes few times in a week)
I get SocketStarted := false (code is at the end of mail).
Well, clearly the connection is being disconnected somewhere in order for
that to happen. If you are not calling Disconnect() on your end, then the
server is closing the connection on its end instead.
Gambit
I wrote the server and the client app. - there is no event that use
Disconnect() - server works 24/7 - I connect a few Clients on it.
Server and Client are talking constantly - during a day talking is very
often (each second), but in a night it is from time to time (each minute).
Connection breaks usually during a day. As I sad - I use different PC and
different Lan Switch - I don't suspect on hardware.
I'm wrestling with this problem for a long time with no success.

Is there any variable on server (idTCPServer) that I can increase or
decrease to fix this kind of problem ?

Thx , again
Remy Lebeau (TeamB)
2008-06-20 18:28:36 UTC
Permalink
Post by Pera Detlic
I wrote the server and the client app. - there is no event that use
Disconnect() - server works 24/7
Is there a firewall/router in between the client and server? The server may
be running 24/7, but the connection could be getting disconnected
externally, such as due to the connection being idle too long.


Gambit
Pera Detlic
2008-06-21 07:01:52 UTC
Permalink
Post by Remy Lebeau (TeamB)
Post by Pera Detlic
I wrote the server and the client app. - there is no event that use
Disconnect() - server works 24/7
Is there a firewall/router in between the client and server? The server
may be running 24/7, but the connection could be getting disconnected
externally, such as due to the connection being idle too long.
Gambit
No, all windows firewalls are disabled and lan is pure - only switch.
Network is local and without any connection to internet.
There is no antivirus or antispam or firewall any kind of software which can
provide such a conflict.
Simply - just windows with latest service pack's and my server and client
application.
Windows users are limited (they are not administrators) and all cd, usb
....etc are disabled - so, nobody can install anything.
User use only Client application - just that - no other windows utility is
used.
Whole project was planed and analysed to have as much as possible less
things that can potentially be a problem.

Loading...