c++ - How do I set timeout for TIdHTTPProxyServer (not connection timout) -


i using tidhttpproxyserver , want terminate connection when success connect target http server receive no response long time(i.g. 3 mins) find no related property or event it. , if client terminate connection before proxy server receive response http server. onexception event not fired until proxy server receive response. (that is, if proxy server still receive no response http server, not know client has terminate connection...)

any appreciated.

thanks!

willy

indy uses infinite timeouts default. asking for, need set readtimeout property of outbound connection target server. can access connection via tidhttpproxyservercontext.outboundclient property. use onhttpbeforecommand event, triggered before outboundclient connects target server, eg:

#include "idtcpclient.hpp"  void __fastcall tform1::idhttpproxyserver1httpbeforecommand(tidhttpproxyservercontext *acontext) {     static_cast<tidtcpclient*>(acontext->outboundclient)->readtimeout = ...; } 

Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c# - Copy ObservableCollection to another ObservableCollection -

All overlapping substrings matching a java regex -