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

How to disconnect client #27

Open
microadam opened this issue Feb 15, 2015 · 6 comments
Open

How to disconnect client #27

microadam opened this issue Feb 15, 2015 · 6 comments

Comments

@microadam
Copy link
Contributor

Hello,

Trying to figure out how to disconnect the currently connected client.

I figured calling server.stop() would do this, but this doesn't seem to do anything.

Am I missing something?

Thanks

@stephen
Copy link
Owner

stephen commented Feb 16, 2015

Hm, there's currently no method to forcibly disconnect a client. What's the usecase for doing this, rather than having the client disconnect itself?

@microadam
Copy link
Contributor Author

I have a system whereby outputs are dynamically added and removed. When a client connects, if there are no outputs available, I would like to disconnect them. Similarly, if while a client is connected, all the outputs are removed, I would also like to disconnect them (can link you to some code if you are interested).

On 16 Feb 2015, at 01:13, Stephen Wan [email protected] wrote:

Hm, there's currently no method to forcibly disconnect a client. What's the usecase for doing this, rather than having the client disconnect itself?


Reply to this email directly or view it on GitHub.

@stephen
Copy link
Owner

stephen commented Feb 16, 2015

Code sample would be nice!

Hmm, I'm not sure if there's a built in way for speakers to disconnect a client. The simplest (but forceful) way would be to kill the RTSP connection and stop sending packets. Would want to test to see how quickly the client sees the disconnect.

@microadam
Copy link
Contributor Author

Forceful would be fine. I figured server.stop() would do the trick, but it doesn't seem to do anything.

Code sample here:

https://github.com/microadam/airproxy/blob/master/lib/group.js

The 2 places where I do

server.stop()
server.start()

On 16 Feb 2015, at 20:24, Stephen Wan [email protected] wrote:

Code sample would be nice!

Hmm, I'm not sure if there's a built in way for speakers to disconnect a client. The simplest (but forceful) way would be to kill the RTSP connection and stop sending packets. Would want to test to see how quickly the client sees the disconnect.


Reply to this email directly or view it on GitHub.

@jessepollak
Copy link

+1 for this :)

@jessepollak
Copy link

This is fixed in #41.

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

3 participants