ClankBundle icon indicating copy to clipboard operation
ClankBundle copied to clipboard

Close connection

Open abenz1267 opened this issue 11 years ago • 12 comments

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

abenz1267 avatar Apr 11 '14 11:04 abenz1267

you want to close connection from client or server side?

Venzon avatar Apr 20 '14 23:04 Venzon

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.

abenz1267 avatar Apr 21 '14 19:04 abenz1267

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

Venzon avatar Apr 21 '14 20:04 Venzon

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.

abenz1267 avatar Apr 21 '14 20:04 abenz1267

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

Venzon avatar Apr 21 '14 21:04 Venzon

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.

abenz1267 avatar Apr 22 '14 12:04 abenz1267

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

alcalyn avatar Aug 08 '14 15:08 alcalyn

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

julienfroidefond avatar Oct 07 '15 17:10 julienfroidefond

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

Venzon avatar Oct 07 '15 20:10 Venzon

@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 avatar Oct 08 '15 11:10 julienfroidefond

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

julienfroidefond avatar Oct 09 '15 05:10 julienfroidefond

@julienfroidefond I am glad I could help, cheers m8

Venzon avatar Oct 09 '15 09:10 Venzon