ghedipunk / PHP-Websockets

A Websockets server written in PHP.
BSD 3-Clause "New" or "Revised" License
913 stars 375 forks source link

Error Connect with Android + FireFox 52.0.2 #97

Open fazelit opened 7 years ago

fazelit commented 7 years ago

Firefox has problems with Android version 52.02. But Firefox 52.02 computer, no problem

ghedipunk commented 7 years ago

What error is Firefox for Android showing?

What does the server's output show when the Android client attempts to connect?

Is there anything that you can give us beyond "it doesn't work"?

fazelit commented 7 years ago

error: Client connected. Resource id #14 Client disconnected. Resource id #14 in android firefox version 52.02 But pc firefox version 52.02 Not disconnect.

ghedipunk commented 7 years ago

That narrows it down to failing the handshake. It'll take some time before I can troubleshoot further, but I'll get on it when I can. Thanks!

fazelit commented 7 years ago

I do the following to solve the problem: add sleep(1); on function connect() `

protected function connect($socket) {

$user = new $this->userClass(uniqid('u'), $socket); 

sleep(1); 

$this->users[$user->id] = $user; 

$this->sockets[$user->id] = $socket;

$this->connecting($user); 

} `

But quickly connect comes down. Why? There is a better way?

blondie101010 commented 7 years ago

One thing is for sure, putting a sleep there (or anywhere in that code actually) will either slow everything down or prevent other connections from working.

fazelit commented 7 years ago

I know But what a way to connect Firefox Android?

tomthedude commented 5 years ago

i am having the same issue with android + chrome on desktop + chrome wotks ok, but on android + chrome can not connect to socket, same error as above.