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

Problem with DNS request in socket connector #256

Closed
mr-older opened this issue Jun 19, 2021 · 3 comments
Closed

Problem with DNS request in socket connector #256

mr-older opened this issue Jun 19, 2021 · 3 comments
Labels

Comments

@mr-older
Copy link

Error while creating DNS Query
$query = new Query($domain, $type, Message::CLASS_IN);)

in
resolveAll($domain, $type),

construct doesn`t happen:
Argument 1 passed to React\Socket\TimeoutConnector::React\Socket{closure}() must be an instance of Exception, instance of Error given, called in /../promise-master/src/Internal/RejectedPromise.php on line 33

$loop = React\EventLoop\Factory::create();
$client_socket = new React\Socket\Connector($loop);

$client_socket->connect('google.com:443')->then(function(React\Socket\ConnectionInterface $connector) {
	},
	function(Throwable $error) {
		echo $error->getMessage();
	}
);

Everything is running normally using ip instead of domain name.

PHP 7.3.27 on debian 10.8,
event-loop 1.1.1 (2020-01-01),
promise 3.0.0 (xxxx-xx-xx),
dns 1.5.0 (2021-03-05),
socket 1.6.0 (2020-08-28),
cache 1.1.0 (2020-09-18),
evenement v3.0.1 (2017-07-23)

The same is true for promise 2.8.0 (2020-05-12) with the following:

google.com:443: Argument 1 passed to React\Socket\TimeoutConnector::React\Socket{closure}() must be an instance of Exception, instance of Error given, called in /.../react/promise-master/src/RejectedPromise.php on line 28

Am I doing something wrong?

@mr-older
Copy link
Author

This error I've got after upgrading from older versions. No changes in my code and still can`t figure out, what exactly could be missed.

@clue
Copy link
Member

clue commented Jun 19, 2021

@mr-older Thank you for reporting, this definitely shouldn't have happened!

We're not aware of any such issues and I can not reproduce the problem you're seeing locally. Can you provide a gist for me to reproduce?

Also, the paths in your exception output seem kind of strange, did you perhaps manually patch your installation? If not, can you try reinstalling and provide your composer.lock along with your gist?

@mr-older
Copy link
Author

Thank you very much for the answer. I'm not using composer, cause this library is the only one that my project needs. Without composer the project is much lighter and starts faster. Heavy responsibility is also a great reason of minimal using of third-party code: I have to be responsible for using your code, as it were mine.

The misorder of included files in react/dns module was the problem and it was easily resolved by analyzing of "use" sections of your files, thanks a lot!

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

No branches or pull requests

2 participants