 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Osman AKDEMİR Guest
|
Posted: Sat Apr 24, 2004 9:26 am Post subject: Suspend Mode |
|
|
Hi everybody,
I have an application that's TCP client/Server. Everything is fine but
there is a problem. If I wait long time for ex 2-3 hour without doing
anything (not sending any data between client-server) and after that If I
try to send any data to server which I connected I coludn't send my data or
I colundt get any data. And I jump time out while reading data from
server...
Actually I wanted to ask a question is there a suspend mode (or like
this) in socket programming or winsock or inside the indy component?
Please help me because it's very important....
Thanks for all....
|
|
| Back to top |
|
 |
Martin James Guest
|
Posted: Sat Apr 24, 2004 9:41 am Post subject: Re: Suspend Mode |
|
|
"Osman AKDEMİR" <osman.akdemir (AT) partneronline (DOT) org> wrote
| Quote: | Hi everybody,
I have an application that's TCP client/Server. Everything is fine but
there is a problem. If I wait long time for ex 2-3 hour without doing
anything (not sending any data between client-server) and after that If I
try to send any data to server which I connected I coludn't send my data
or
I colundt get any data. And I jump time out while reading data from
server...
Actually I wanted to ask a question is there a suspend mode (or like
this) in socket programming or winsock or inside the indy component?
|
No 'suspend mode' is required.
TCP will, by default, keep connections open for ever. If the connection is
closing at one end, it is because you, or possibly some proxy router, is
timing it out somewhere & closing the connection.
Put some debug/breakpoints in to find out which end is disconnecting & fix
the problem. Initially, run the server & client on the same box so there
are no network switches or proxies in the way.
Rgds,
Martin
|
|
| Back to top |
|
 |
Ben Hochstrasser Guest
|
Posted: Sat Apr 24, 2004 12:00 pm Post subject: Re: Suspend Mode |
|
|
Martin James wrote:
| Quote: | TCP will, by default, keep connections open for ever. If the
connection is closing at one end, it is because you, or possibly some
proxy router, is timing it out somewhere & closing the connection.
|
Many servers (ftp being a typical example) will close connections that were
idle for more than x minutes. Sometimes even the underlying TCP/IP stack
will do this in order to "housekeep" the system.
You may want to send a heartbeat packet every couple of minutes to keep the
connection alive.
--
Ben
|
|
| Back to top |
|
 |
Milan Guest
|
Posted: Wed May 12, 2004 1:08 pm Post subject: Re: Suspend Mode |
|
|
Yes, Indy has implemented timeout. There's your problem. But it's much
better if you disconnect and connect again after those 2-3 hours. Set
timeout to something like a couple of minutes and connect if disconnected
when sending data.
| Quote: | this) in socket programming or winsock or inside the indy component?
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|