Giter Site home page Giter Site logo

Comments (13)

elbowz avatar elbowz commented on July 23, 2024

shit...with the develop branch?

I have tried and It seems works :( ...I have done some mistake, sorry

from xbmc.service.pushbullet.

ruuk avatar ruuk commented on July 23, 2024

Yeah, the develop branch.

There are 2 things going on here I think.

One is that a socket can remain valid for 5 minutes during a network disconnect, but eventually if the network is disconnected long enough the socket will have an error. So you would have to leave the socket disconnected for a while to really test this. I'm not sure how this works for suspend (at least on Linux systems, see below about windows) because it may not count the time during suspend as part of the timeout duration.

The other issue I read about is that windows specifically resets TCP connections when a network interface goes down (which is stupid). So, since I am testing on windows, the problem happens immediately, whereas on Linux it it takes a while (ie the socket can survive interruptions of minutes).

I need to do more testing before I know what is exactly going on. It seems weird that there is no error or debug message in the log, so perhaps I will have to wait longer to see if something else happens. If something does take a while to happen, then we will need a way to detect that the socket is no longer working.

from xbmc.service.pushbullet.

elbowz avatar elbowz commented on July 23, 2024

5 minutes? Where have you find this value?
I have tested only for 1 or 2 minutes :(

It seems weird that there is no error or debug message in the log

I don't know if this can be related, but seems that python threads can't throw error: http://stackoverflow.com/questions/2829329/catch-a-threads-exception-in-the-caller-thread-in-python

...and my websocket is in a thread...

from xbmc.service.pushbullet.

ruuk avatar ruuk commented on July 23, 2024

5 minutes? Where have you find this value?
I have tested only for 1 or 2 minutes :(

Just something in a web search. It said linux could be up to 5 minutes. It varies. In any case, the device could be suspended for a day, and we don't want the service to not work when they resume.

It seems weird that there is no error or debug message in the log
I don't know if this can be related, but seems that python threads can't throw error: http://stackoverflow.com/questions/2829329/catch-a-threads-exception-in-the-caller-thread-in-python

...and my websocket is in a thread...

Well, threads can throw an error, they just can't be caught outside the thread.
I think we can use an Event() or something and in Pushbullet._websocketThread() after self._ws.run_forever(ping_interval=6, ping_timeout=self.ping_timeout) returns, we check for xbmc.abortRequested and set the event. The sleep loop in Service.init() could check for this event and then re-start the service. This is just a quick idea, but something like this should work.

from xbmc.service.pushbullet.

elbowz avatar elbowz commented on July 23, 2024

I'll glad to see your solution ended :)

...I have just retried develop branch, and I can confirm that on Linux works good. I have waited 10 minutes (non more)...

But this works only with:
self._ws.run_forever(ping_interval=6, ping_timeout=self.ping_timeout)

if you don't set ping_interval, the socket dies and this error is throw:

09:02:54 T:140659227932416 ERROR: No handlers could be found for logger "root"

boh :)

from xbmc.service.pushbullet.

ruuk avatar ruuk commented on July 23, 2024

I'll glad to see your solution ended :)

What? I don't understand what you mean.

...I have just retried develop branch, and I can confirm that on Linux works good. I have waited 10 minutes (non more)...

But this works only with:
self._ws.run_forever(ping_interval=6, ping_timeout=self.ping_timeout)

if you don't set ping_interval, the socket dies and this error is throw:

09:02:54 T:140659227932416 ERROR: No handlers could be found for logger "root"
boh :)

To bad it doesn't work on windows. I'm surprised it doesn't get disconnected from the Pushbullet end after ten minutes.

from xbmc.service.pushbullet.

elbowz avatar elbowz commented on July 23, 2024

Linux...is Linux :P

I don't though, but XBMC works also on my VirtualBox guest machine with Windows 7 (I don't have daughter ;) ...I'll try to mess up with the code.

what machine do you use?

from xbmc.service.pushbullet.

ruuk avatar ruuk commented on July 23, 2024

I develop on Ubuntu
My main device for watching stuff is an Ouya
I have Virtual Machines for testing Win8, Win7, Vista and OSX
I have a Raspberry Pi for testing with OpenElec, Raspbian and RaspBMC
I have a Samsung Note 3 (phone) for normal android testing
And I have my daughters laptop if I need a real Windows machine

from xbmc.service.pushbullet.

elbowz avatar elbowz commented on July 23, 2024

Great! You could test whole XBMC platforms supported...

but I like leave this job to the users :)

from xbmc.service.pushbullet.

ruuk avatar ruuk commented on July 23, 2024

So do I, but when an error is found, sometimes a debug log isn't enough :)
Sometimes you need to duplicate it yourself.

from xbmc.service.pushbullet.

elbowz avatar elbowz commented on July 23, 2024

Yeah, I agree with you...but we are the only that use issue form on github ;) for now...

from xbmc.service.pushbullet.

ruuk avatar ruuk commented on July 23, 2024

Just wanted to let you know that the code from the disconnect branch fixes the issue with sleep/suspend. Tested it with my daughters laptop, and everything was working great after resuming.
I guess I'll close this issue.

from xbmc.service.pushbullet.

elbowz avatar elbowz commented on July 23, 2024

Great! Thank your daughter!

from xbmc.service.pushbullet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.