From time to time, I notice that my server logs an error:
[warn] Ignoring unmatched topic "buses:x" in MyApp.Schools.SchoolSocket
Sometimes, I restart the server and the warning is gone, sometimes I restart servers but the warning still there…
I don’t know how to fix this issue, please help!
What are the channel definitions in your application? e.g.:
channel "buses:*", MyApp.Schools.BusChannel
So you are either missing a catch-all like “buses:*”, and instead have sth like “buses:something_literal” or you are missing a busses definition altogether.
The default Phoenix generated socket file is MyApp.Web.UserSocket. Your original post mentioned something about MyApp.Schools.SchoolSocket. Did you just rename that file and module, or do you have multiple sockets listed in your endpoint?
Do you have a repository that you would be able to show us?
I have two websockets, using two end points, MyApp.Schools.SchoolSocket can be reached using the second end point at port 4011, I will try to deploy the repo so that I can share it here
I think we have found the problem source, it’s that we were joining channel before waiting socket to get actually opened at android side , I am not sure, but now we join channel only after the socket got opened.
*1. connect the socket.
*2. when connected, join the channel
*3. the channel is successfully joined
*4. start pushing (long, lat) message to the joined channel, each 5 seconds. This works fine, and the message is broadcasted as expected inside the topic at server side.
~~ now produce the issue ~~
*5. disconnect the phone internet connection.
*6. reconnect the phone internet connection.
*7. the client will try to re-connect the socket again.
*8. the client successfully reconnect
*9. my app is trying to push data to the channel as it did in step 4, then, I will start seeing the error at server side:
[warn] Ignoring unmatched topic "buses:x" in MyApp.Schools.SchoolSocket
I don’t believe there is currently an official android client. You could always try to send in a pull request to the project if you are able to in order to fix an issue like this.