Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timeout doesn't work #39

Open
jgcabral opened this issue Apr 9, 2018 · 7 comments
Open

Timeout doesn't work #39

jgcabral opened this issue Apr 9, 2018 · 7 comments

Comments

@jgcabral
Copy link

jgcabral commented Apr 9, 2018

I'm extending class and inside function constructor i set timeout = 250(ms) but i when execute the script delay more time. Often it happen with email address hotmail.

@zytzagoo
Copy link
Owner

Can you show where/how exactly you're doing that?
This class's constructor does not accept timeout as an option by default, so hard to tell what's going on in some custom code of yours...

Are you using setConnectTimeout()? Are we talking about connect timeout at all, or some other timeout?
Unit tests show that setting/getting the connect timeout works as expected. Functional test too.

@jgcabral
Copy link
Author

The code is the following.
$validator = new EmailValidator($email, $sender);
$validator->setConnectTimeout(0.25);
but when i enter any address hotmail's, delay a lot of time.

@zytzagoo
Copy link
Owner

Connect timeout must (currently) be specified as integer seconds, not float (https://secure.php.net/stream_set_timeout is used), so that might be one of the reasons why its "not working", but we'll have to define what not working really means in this context...

Do you have some debug logs/timestamps which show that the delay is actually happening at the connect phase?

Could it be that Hotmail is throttling you due to bad/spammy behaviour and/or bad/spammy ip reputation/history?

@zytzagoo
Copy link
Owner

Does setting the connect timeout to 1 (second) help as a workaround? Or does that also have no effect at all?

@jgcabral
Copy link
Author

You're right, i think hotmail's servers are generating delay. I have tried setting 1 second but no success. I need to set 250 ms for any email server. I have no logs to show you,

@zytzagoo
Copy link
Owner

Feature request 1: Maybe being able to set sub-second connectTimeout, but even if implemented, it does not help with server-generated delays/throttling.

Feature request 2: Detecting delays/throttling (and maybe dropping the connection in that case, and it being somewhat configurable)

These are not something I planned on adding myself (no need for it), however, if someone contributes the code and tests for it, I'll more than gladly review and merge.

@jgcabral
Copy link
Author

Ok, thanks anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants