yii-node-socket icon indicating copy to clipboard operation
yii-node-socket copied to clipboard

how do you close connection?

Open jpodpro opened this issue 8 years ago • 11 comments

unless i refresh the page, i get an infinite heartbeat loop. there is no obvious way to stop listening once socket.onConnect has been run.

the log continues to output this until i refresh the page:

debug: emitting heartbeat for client 8Oo3AOzC54cFoAp5_J0D debug: websocket writing 2:: debug: set heartbeat timeout for client 8Oo3AOzC54cFoAp5_J0D debug: got heartbeat packet debug: cleared heartbeat timeout for client 8Oo3AOzC54cFoAp5_J0D debug: set heartbeat interval for client 8Oo3AOzC54cFoAp5_J0D

jpodpro avatar Apr 03 '16 07:04 jpodpro

Yep, theris no way to turn off heartbeat

I am do not understand what are you need from the library? How do you use it? 3 апр. 2016 г. 10:37 пользователь "jpodpro" [email protected] написал:

unless i refresh the page, i get an infinite heartbeat loop. there is no obvious way to stop listening once socket.onConnect has been run.

the log continues to output this until i refresh the page:

debug: emitting heartbeat for client 8Oo3AOzC54cFoAp5_J0D debug: websocket writing 2:: debug: set heartbeat timeout for client 8Oo3AOzC54cFoAp5_J0D debug: got heartbeat packet debug: cleared heartbeat timeout for client 8Oo3AOzC54cFoAp5_J0D debug: set heartbeat interval for client 8Oo3AOzC54cFoAp5_J0D

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/oncesk/yii-node-socket/issues/78

oncesk avatar Apr 03 '16 07:04 oncesk

so once i open a connection to the server i cannot close it? that is terrible!

jpodpro avatar Apr 03 '16 07:04 jpodpro

No, you can close connection) 3 апр. 2016 г. 10:55 пользователь "jpodpro" [email protected] написал:

so once i open a connection to the server i cannot close it? that is terrible!

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/oncesk/yii-node-socket/issues/78#issuecomment-204904441

oncesk avatar Apr 03 '16 08:04 oncesk

why don't you go ahead and just explain how instead of forcing me to beg?

jpodpro avatar Apr 03 '16 08:04 jpodpro

What are you problem?

oncesk avatar Apr 03 '16 08:04 oncesk

i already told you! once i call socket.onConnect i cannot close the connection without reloading the page. not an option for a single page app.

jpodpro avatar Apr 03 '16 08:04 jpodpro

I saw the code and in js no close method for closing connection, but when you close or reload your browser tab connection will be closed, and opened again when tab is loaded and new yiinodesocket instance will created

You can add simple method close

You using ipv6 but in your configuration you did not add ipv6 address 3 апр. 2016 г. 11:05 пользователь "jpodpro" [email protected] написал:

why don't you go ahead and just explain how instead of forcing me to beg?

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/oncesk/yii-node-socket/issues/78#issuecomment-204909627

oncesk avatar Apr 03 '16 08:04 oncesk

Just now i added close method

I saw the code and in js no close method for closing connection, but when you close or reload your browser tab connection will be closed, and opened again when tab is loaded and new yiinodesocket instance will created

You can add simple method close

You using ipv6 but in your configuration you did not add ipv6 address 3 апр. 2016 г. 11:05 пользователь "jpodpro" [email protected] написал:

why don't you go ahead and just explain how instead of forcing me to beg?

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/oncesk/yii-node-socket/issues/78#issuecomment-204909627

oncesk avatar Apr 03 '16 08:04 oncesk

Just now i added close method

this is not helpful. reloading page is not a good solution to closing a connection. good coding standards are to clean up resources when they are not being used. not providing a close method is bad practice.

jpodpro avatar Apr 03 '16 08:04 jpodpro

So, i am do not understand what are you want, you can not emit events from php??? 3 апр. 2016 г. 11:44 пользователь "jpodpro" [email protected] написал:

Just now i added close method

this is not helpful

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/oncesk/yii-node-socket/issues/78#issuecomment-204915383

oncesk avatar Apr 03 '16 09:04 oncesk

i want to listen for server messages and then stop listening for server messages without reloading the page.

jpodpro avatar Apr 03 '16 19:04 jpodpro