Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
parfeon
Visitor

Catch internet disconnection while performing long-poll request.

Using roURLTransfer component in my channel I perform long-poll request and wait for responses from service. While waiting for response I've tried to disconnect ethernet cable and waited for 10 seconds. After I connected cable back and connected with Terminal to console I find out what request still alive and after some time even received response from my backend. 

Question is: is roURLTransfer able to trigger any errors related to network issues or it will just re-initialize request and keep working with it waiting response?

Best regards,
Sergey Mamontov
0 Kudos
2 REPLIES 2
EnTerr
Roku Guru

Re: Catch internet disconnection while performing long-poll request.

it is in the very nature of TCP/IP to persevere through network issues like lost packages and not to time out established TCP connections.  Unplugging the network cable is an example of that.

roUrlConnection eventually times out i think, just wait more. It could fail with other errors too, have a look at roUrlEvent
0 Kudos
parfeon
Visitor

Re: Catch internet disconnection while performing long-poll request.

Hi, thanks for your response.

I've tried to send request w/o network at all (unplugged cable before running my app w/o debugger).
After some time, I plugged cable back and connected with debug to find out, what request after all has been sent and I got some response. I understand what socket may survive some time if it has been opened, but in this case it not even started - why I still don't get any errors is a mystery for me.

Best regards,
Sergey Mamontov
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.