JDare / ClankBundle

A Symfony2 Bundle for use with Ratchet WebSocket Server
MIT License
131 stars 31 forks source link

Close connection #21

Open abenz1267 opened 10 years ago

abenz1267 commented 10 years ago

Well, how to close a connection without reloading the page? F.e:

$(document).ready(function(){
clank.close(); });

Or something like that. Is it possible to close the connection (without reloading/closing browser )?

Regards

Venzon commented 10 years ago

you want to close connection from client or server side?

abenz1267 commented 10 years ago

Wanted to close from client side. Doesn't matter anymore. Not using this bundle anymore ... using only Ratchet now. Way less hassle at the end of the day.

Venzon commented 10 years ago

so u think that bundle is useless and its better to implement rachet without it?

abenz1267 commented 10 years ago

At least i have way less problems since i did it. ZeroMQ implementation without a problem etc. ...and also finding support on the www seems to be way easier. Literally every problem i had with this bundle got solved by ....not using it.

Venzon commented 10 years ago

thx mate, I think I will go this way also do u know maybe other way then ZMQ to make a call to ws rachet server from php? some way not requiring installing extra php extension...? I use this lib https://github.com/bazo/wamp-client but it does not support receiving response from server

abenz1267 commented 10 years ago

Hm, no..don't know. Sorry. I can't recommend using shared hosting anyways. At least get a vServer, so u can install whatever you need.

alcalyn commented 10 years ago

I can easily close the connection from client side by using clankSession.close(); of this bundle.

To access clankSession global variable in javascript, see https://github.com/JDare/ClankBundle/issues/19#issuecomment-51613870

julienfroidefond commented 8 years ago

Hi, i need to do that server side but in my service with the disconnect event listener, i dont have access to the topic to call its unsubscribe function. Anyone can help me ? I dont how to communicate to the topic by the connection interface only...

Venzon commented 8 years ago

@julienfroidefond better try to switch to https://github.com/GeniusesOfSymfony/WebSocketBundle - its based on clank

julienfroidefond commented 8 years ago

@Venzon thx ! I just migrate. I ll try to do the same but it seems in fact better than clank. Thx for the advice. Why there isn't no messages about that repo in the readme ?

julienfroidefond commented 8 years ago

@Venzon : All is ok for me with the gos bundle. Thx again; it's a really amazing time saver work !

Venzon commented 8 years ago

@julienfroidefond I am glad I could help, cheers m8