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

long poll protocol stops polling #1459

Open
alahammad opened this issue Jul 14, 2023 · 6 comments
Open

long poll protocol stops polling #1459

alahammad opened this issue Jul 14, 2023 · 6 comments

Comments

@alahammad
Copy link

CometD version 4.0.4

Description
We have implementation of cometD in our App (Android/iOS), recently we faced issue, the long poll protocol stops polling when user change network from wifi to mobile network. he can send data but can't receive .
the logs is return success .

@sbordet
Copy link
Member

sbordet commented Jul 14, 2023

Sorry, too little information to help you.

Do you have the CometD debug logs that show the problem?
Stack trace?

@alahammad
Copy link
Author

I can't share logs because of employment policy. what i can there is request going from client and response is successful
the missing /meta/connect stopped sending, means client stop polling messages from server
i am sure i miss configuration for this.

@alahammad
Copy link
Author

part of logs when user change network connection :
[java.net.SocketException: Software caused connection abort, java.net.SocketException: Software caused connection abort, java.net.SocketException: Software caused connection abort, java.net.SocketException: Software caused connection abort, java.net.SocketException: Software caused connection abort]

@sbordet
Copy link
Member

sbordet commented Jul 16, 2023

What you can try is to ask iOS/Android to notify you of the network change.
When you get the notification, you call disconnect() and you handshake() again.

In theory there should be no need to do this, as CometD will catch the SocketException and try to open a new connection, which should happen on the new network, so the connection will be seamlessly re-established.

@alahammad
Copy link
Author

alahammad commented Jul 16, 2023

Actually cometD it catch Socket exception, only polling request stops. I need a way to start polling from server again, in case user change mobile network or polling stops

@sbordet
Copy link
Member

sbordet commented Jul 16, 2023

Actually cometD it catch Socket exception, only polling request stops.

It is not supposed to stop. We have a large number of tests for this scenario.

You have to provide proof of what's going on, so we can determine whether you are hitting a corner case, and if so we can fix it.

As I said, network interruptions are expected in CometD, there is a configurable retry mechanism, and everything works fine with normal networks and OSes.

I think the problem is more on the mobile side where CometD tries to open a new connection, but iOS/Android still gives CometD the old stack with the old network so when CometD tries to open a new connection it fails.

IIRC, both iOS and Android have ways to communicate network changes, so you can try the workaround I described in a previous comment (disconnect + handshake).

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

No branches or pull requests

2 participants