Keep connection alive problem

Hi,
I set “KeepAlive” to true both sides (server & client). But it still will disconnect the session. How to keep connection alive without timeout or reconnect the session automatically?

Hi,

KeepAlive http header has no influence to server session and vice versa.
if you want to keep session on server-side, you should call any service method with specific timeout.
default session timeout is 15 min so you should call, for example, empty service method each 5-10 minutes.

Hi,
I don’t want to have session timeout. Because users will using “Remote Desktop” who will not close the application forever except system update.

Hi,

You can specify a big value as SessionManager.SessionDuration.
For example, if you set MaxInt (i.e. $7FFFFFFF) , session will expire in $7FFFFFFF minutes that equals to 5627 years

Hi,
Noted with thanks. I will test it.

Hi,
I tested your suggestion last night and today. It works if DA server in local develop environment. But it doesn’t work if DA server in production environment. It has ‘Socket Error # 10054 Connection reset by peer.’

Hi,

this is socket error - you can’t keep http connection for 1,5 days so you can ignore it.
session should be not expired.

Hi,
Sorry that I don’t understand how should do about your comment. Should I change the property setting in DAServer side?

Hi,
You can ignore 10054 error.

Hi,
I ignore the error that can’t resume to normal. All features will show “Socket Error #10054…”

Hi,

What channels are you using?

Hi,
I’m using TROIndyHTTPChannel.

Indy likes to spam socket errors. try to use another http channel , like WinInet, Synapse, etc

Hi,
Before I’m using WinInet. But you suggest me to change Indy in both sides. I found some resources who said add “disconnect” command. Then the problem will be solve. Is it works in RO?

RO Channels use Indy channels internally so it should work

Hi,
If DAServer is running in outsides and client connect it by internet connection, then it will have this socket error.

In general, you can use KeepAlive=False

Hi,
It is already KeepAlive = False.

Hi,

on both sides?

Hi,
Yes. Both sides are KeepAlive = False already.