Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
parfeon
Level 7

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
Level 11

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
Level 7

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