Board index » delphi » need help on disconnecting client
API
![]() Delphi Developer |
API
![]() Delphi Developer |
need help on disconnecting client2007-07-10 02:22:04 PM delphi58 hi all, could somebody show example code snippet to how to disconnect one client from the ftp server (indy 10.1.6) if i know address and port which i want to disconnect? thanks |
API
![]() Delphi Developer |
2007-07-10 04:51:53 PM
Re:need help on disconnecting client
following I have tried, but after the correct client is disconnected
succesfully the idftpserver hangs and is not able to close even. so something more needs to be done than just rising exception as in this test: if idftpserver1.Contexts<>nil then with idftpserver1.contexts.locklist do try for p:=0 to count-1 do if (tidcontext(idftpserver1.Contexts.LockList[p]).Binding.PeerIP = addr) and (tidcontext(idftpserver1.contexts.locklist[p]).binding.PeerPort = port) then begin tidcontext(idftpserver1.Contexts.LockList[p]).DoException(exception.create('Disconnected')); messagedlg('Client disconnected', mtinformation, [mbok], 0); exit; end; finally idftpserver1.contexts.UnlockList; end; please help! |
Remy Lebeau (TeamB)
![]() Delphi Developer |
2007-07-11 03:04:13 AM
Re:need help on disconnecting client
"API" <XXXX@XXXXX.COM>writes
Quotefollowing I have tried, but after the correct client is disconnected the list is remaining locked permanently. You should be calling LockList() only once. See my example in the other thread you started for this issue. Quotesomething more needs to be done than just rising exception Gambit |
API
![]() Delphi Developer |
2007-07-11 12:40:31 PM
Re:need help on disconnecting client
Remy Lebeau (TeamB) kirjoitti:
QuoteYou are calling LockList() too many times, and you are not calling Quote
problems on this how i tried to do this. You're doing great job here! |