Solved

Indy: TIdTCPServer.OnDisconnect woes (part II)

Posted on 2004-09-21
4
382 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Copy file in dll not working but working on exe ! 18 93
Delphi TcxGrid group footer summary 3 261
Delphi: how to send PJL commands to printer 3 97
oracle global variables 4 68
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
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 …
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

785 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