Solved

Indy: TIdTCPServer.OnDisconnect woes (part II)

Posted on 2004-09-21
4
380 Views
Last Modified: 2011-09-20
It appears that the AThread.Connection.Socket.Binding property is not assigned if a client crashes (AThread: TIdPeerThread is the argument of the TIdTCPServer.OnDisconnect event). How can I get the IP address and the port of the connection that has gone (AThread.Connection.Socket.Binding.PeerIP, AThread.Connection.Socket.Binding.PeerPort)? I need them to free corresponding resources. Actually I loop through an IP-port list and look up the item that's missing in my server instance (<- not very clever?).

Thanks!
0
Comment
Question by:__alex
  • 2
  • 2
4 Comments
 
LVL 12

Expert Comment

by:Ivanov_G
ID: 12114440
I am not sure I understood you, but maybe it is released when the socket crashes... You can rely on some external storage for the connections, because when client crashes, the socket is gone...
0
 
LVL 2

Author Comment

by:__alex
ID: 12130427
Yep, that's what I want to avoid (to keep things simple).
0
 
LVL 12

Accepted Solution

by:
Ivanov_G earned 500 total points
ID: 12131786
try to handle this in TTCPServer.OnException - there you have the thread of the client...
0
 
LVL 2

Author Comment

by:__alex
ID: 12132539
Perfect!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Best Firemonkey component pack 1 86
Convert GUI app into console app for Win32 Env 5 78
control image tags in a string ? 12 110
Firemonkey webbrowser scrollbars ? 1 29
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now