Copy link to clipboard
Copied
Hello, there.
What would be the better approach for using the Sockets in AS3.
1st) open one connection and keep it alive until the site unloads?
2nd) open a connection, use it, and close it when done; then, open again when I need?
Considering a scenario where some users will make a constant use of the Socket, but others will almost not use it, what would be the better approach? Does an alive Socket connection use too much bandwidth? Does the action of connecting consumes more than keeping it alive? What is your opinion?
Thank you all!
CaioToOn!
Copy link to clipboard
Copied
Keep it alive!
When you establish new connection with the socket you will wait to rise a connect event before operted with it. If you keep it alive you can operate with it in any time.
The weight of this massage is only few bytes
Copy link to clipboard
Copied
Thank you, Kalisto.
I would like to know how much expensive (in time and bandwidth) is to keep a Socket alive against connecting it, is there any information about it around there?
Thank you,
CaioToOn!
Copy link to clipboard
Copied
I think that kind information is inposible to be get because it depends of internet connection. From some users the time will be less from the other users.
Also keep alive msg may depend from protocol and my be only one Byte sendend on every 15 sek ( for example )
Copy link to clipboard
Copied
Thank you again, Kalisto.
I will search for an accurated information. If I found, I post.
Thank for pointing out the way!
CaioToOn!
Copy link to clipboard
Copied
yw,
If you dicsover something please let me know.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now