amphp / mysql

An async MySQL client for PHP, optimizing database interactions with efficient non-blocking capabilities. Perfect for responsive, high-performance applications.
Other
358 stars 63 forks source link

Fail to connect code is bogus #4

Closed Danack closed 9 years ago

Danack commented 9 years ago

The code here seems quite wrong.

It's not checking that $socket is not null, and so I'm getting the error fclose() expects parameter 1 to be resource, null given in ...amp-mysql/lib/Connection.php on line 138.

Also, I think it should be checking for the error first and calling the $future->fail regardless of connection state.

bwoebi commented 9 years ago

I hope it is fixed now, it shouldn't loop authentications anymore.