문제

We use TIdSMTPRelay to relay some messages. Sometimes the receiving email server will hang and just keep the connection open and our relayer never times out. Is there a way of giving it e.g. 5 mins to deliver the message and then give up?

도움이 되었습니까?

해결책

TIdSMTPRelay has ConnectTimeout and ReadTimeout properties. Indy does not have a SendTimeout property, so if the hang is occurring during a send rather than a connect/read, the only option would be to manually assign an SO_SNDTIMEO timeout on the underlying socket itself, such as by using the Socket.Binding.SetSocketOption() method in the OnConnect event.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top