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

Are there methods to start and stop ssdp after creating #2

Open
imnotbob opened this issue May 13, 2017 · 3 comments
Open

Are there methods to start and stop ssdp after creating #2

imnotbob opened this issue May 13, 2017 · 3 comments

Comments

@imnotbob
Copy link

imnotbob commented May 13, 2017

My service stops advertising once it is connected via
It was created via:
ssdpServer = ssdp(...)
ssdpeServer.advertise(...)

ssdpServer.stop()

Is there a method to continue/restart advertising? would it be ssdpServer.start(), or some other cleanup / recreation?

@achingbrain
Copy link
Owner

Hmm, that's strange - it shouldn't stop advertising unless you explicitly tell it to. Do you see any stack traces?

@imnotbob
Copy link
Author

Sorry I was unclear. The stop is what I coded, ie. it is a single use service at a time; when I connect I call stop

My question is if I get other errors, is there a clean way (like ssdpServer.start() ?) to restart that service? Currently I exit and let the service be restarted, but was hoping to lower the overhead of restarting the advertisement.

thx

@achingbrain
Copy link
Owner

TLDR: I would just call bus.advertise again.

There's not a lot of overhead in starting an advertisement - it's just a timer that periodically sends some UDP packets to the broadcast address. It will listen on a socket to serve the device description document but you can get it not to do that by passing a location argument to bus.advertise.

https://github.com/achingbrain/ssdp#advertise-a-service
https://github.com/achingbrain/ssdp#full-api-and-options

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