Solved

Indy: TIdTCPServer.OnDisconnect woes (part II)

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

757 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

23 Experts available now in Live!

Get 1:1 Help Now