]
[mailto:[EMAIL PROTECTED]
Behalf Of [EMAIL PROTECTED]
Sent: Wednesday, February 14, 2007 3:38 PM
To: twsocket@elists.org
Subject: [twsocket] OnSessionClosed
Hello,
strange problem here:
- two PCs connected via normal LAN
- one runs my server app (simple TWSocket since the server
only
Hello Markus,
This is how TCP works. OnSessionClosed is fired when the other end say
Goodbye, or when you try to send something and the other end is not
their anymore. There is no traffic if there is no data send, so TCP
layer cannot know if for example cable is plugged out.
So you have to do
Hi Dod,
Did some additional research. If you wants to use TWSocketClient instead
of TWSocket to initiate a connection, then you have to set
FSessionClosedFlag := False; in the OnSessionClosed event. If you do not
then OnSessionClosed will not trigger a second time.
---
Rgds, Wilfried [TeamICS]
Hello Wilfried,
Yes, I came to same conclusion too when you told me it worked fine
with TWSocket. Now I simply set FSessionClosedFlag:=False before
calling .Connect again and all is fine. I also added some
FConnectDidError:=ErrCode in OnSessionConnected so
Hello,
I am actually doing some crash test on my server to handle as many
situations as possible.
I have a problem in a failed socket .Connect
I create a few sockets to .Connect them to some remote points. The
.Connect will excecute and fail because there is nothing listening on
Hello Dod,
In the SessionClosed I start a Timer that will send a message 20
second later to retry a .Connect,
This is the correct way to do it.
but this new try will only produce a
OnSessionConnected not followed by a SessionClosed
Never had that situation. In al my automated