when users pull the plug
-
- Posts: 32
- Joined: 09 Feb 2006, 12:12
when users pull the plug
Hi,
i've been having this problem with smartfox. If anyone can please shed some light on it that would be awesome.
If multiple users are on the server, and one user basically pulls the ethernet cable on their pc, what happens then?
It seems something weird happens on the server, in that all setInterval functions get cleared or stop working for some reason.
I've tried echoing something in the internal event handler function, but I've got nothing coming from there.
I set a setInterval function to check that all users are active every 10 seconds to solve this problem but for some reason when the user gets deactivated, the interval somehow stops working..
so basically, can any1 tell me what happens or how to figure out when a user just pulls the plug out of their pc without disconnecting properly?
i've been having this problem with smartfox. If anyone can please shed some light on it that would be awesome.
If multiple users are on the server, and one user basically pulls the ethernet cable on their pc, what happens then?
It seems something weird happens on the server, in that all setInterval functions get cleared or stop working for some reason.
I've tried echoing something in the internal event handler function, but I've got nothing coming from there.
I set a setInterval function to check that all users are active every 10 seconds to solve this problem but for some reason when the user gets deactivated, the interval somehow stops working..
so basically, can any1 tell me what happens or how to figure out when a user just pulls the plug out of their pc without disconnecting properly?
- goodguy20k
- Posts: 71
- Joined: 10 Jan 2006, 23:58
- Location: Texas, USA
- Contact:
You're creating a local app then? Nothing that goes over the internet?
Lapo was very smart with his code and everytime a user has lost a connection to my server, the user is disconnected nicely. I even get the events for a user leaving the room. (I think that's the one). Here are a few of my experiences that all ended up like that:
User closed browser.
User went to a different page.
User's computer shut off. (Ouch!)
User's internet died.
(Ok, so most of those were me, but it's so cool to refer to yourself as "User". )
Hope this helps.
Lapo was very smart with his code and everytime a user has lost a connection to my server, the user is disconnected nicely. I even get the events for a user leaving the room. (I think that's the one). Here are a few of my experiences that all ended up like that:
User closed browser.
User went to a different page.
User's computer shut off. (Ouch!)
User's internet died.
(Ok, so most of those were me, but it's so cool to refer to yourself as "User". )
Hope this helps.
-
- Posts: 32
- Joined: 09 Feb 2006, 12:12
hei
Thanks goodguy for your reply.
My app is actually working over the internet. And so it gets a little harder to detect when the user disconnects I suppose.
the handler gets called when the user:
closes their window
goes to another page
but not for when they:
simply pull out the ethernet cord from their pc.
My app is actually working over the internet. And so it gets a little harder to detect when the user disconnects I suppose.
the handler gets called when the user:
closes their window
goes to another page
but not for when they:
simply pull out the ethernet cord from their pc.
- goodguy20k
- Posts: 71
- Joined: 10 Jan 2006, 23:58
- Location: Texas, USA
- Contact:
That's what we call "sloppy disconnections" And they can happen more often than you can imagine.
The example you provided is just one of those cases. If you want to do a better experiment try this:
- start the server on one machine
- launch a client on another machine and establish a connection
- now check the connections on the server using netstat (under Windows open a console window and type "netstat"). You will notice the client-server connection in ESTABLISHED status
- now pull the ethernet cable off the client machine
- go back to the server and keep checking the netstat... you'll be amazed in seeing that the connection is still there!!
That's why SmartFoxServer doesn't handle the disconnection, because the lower level TCP layer didn't catch it too
Anyways SFS deals with the problem efficiently by automatically closing all idle connections as specified in the <MaxUserIdleTime> parameter in the config.xml
So, even if you have thousands of those garbage connections, SFS will shut them down automagically
Hope it helps
The example you provided is just one of those cases. If you want to do a better experiment try this:
- start the server on one machine
- launch a client on another machine and establish a connection
- now check the connections on the server using netstat (under Windows open a console window and type "netstat"). You will notice the client-server connection in ESTABLISHED status
- now pull the ethernet cable off the client machine
- go back to the server and keep checking the netstat... you'll be amazed in seeing that the connection is still there!!
That's why SmartFoxServer doesn't handle the disconnection, because the lower level TCP layer didn't catch it too
Anyways SFS deals with the problem efficiently by automatically closing all idle connections as specified in the <MaxUserIdleTime> parameter in the config.xml
So, even if you have thousands of those garbage connections, SFS will shut them down automagically
Hope it helps
-
- Posts: 32
- Joined: 09 Feb 2006, 12:12
figured it was something similar.
Lapo did you code all of smartfox urself?
So why would an interval function stop working only at the exact time that the client pulls the plug? Because I have a set interval function that runs every 10 seconds and tries oto garbage collect, but it gets killed by the disconnect for some weird reason, even if NOTHING else is happening on the server.
But at any rate,I'll definitely use the max idle time setting
Lapo did you code all of smartfox urself?
So why would an interval function stop working only at the exact time that the client pulls the plug? Because I have a set interval function that runs every 10 seconds and tries oto garbage collect, but it gets killed by the disconnect for some weird reason, even if NOTHING else is happening on the server.
But at any rate,I'll definitely use the max idle time setting
-
- Posts: 32
- Joined: 09 Feb 2006, 12:12
also...
Any idea what domain to put in here?:
<AllowedAddress>*.*.*.*</AllowedAddress>
would that be the domain of the web server from which the client is to be downloaded? If so, how does smartfox know that?
Any why won't it let the web server serving the client file to be different from the smartfox server? this only happens on the LAN. It actually lets anyone connect from outside the lan!
This might mean I have to specify hosts for every machine with a local ip, I think? But either way, allowed address of * should allow any1 to connect right? by the way I put the crossdomain.xml file in the root folder of the web server also, still doesn't make a difference.
Be so happy to solver this issue once and for all.
<AllowedAddress>*.*.*.*</AllowedAddress>
would that be the domain of the web server from which the client is to be downloaded? If so, how does smartfox know that?
Any why won't it let the web server serving the client file to be different from the smartfox server? this only happens on the LAN. It actually lets anyone connect from outside the lan!
This might mean I have to specify hosts for every machine with a local ip, I think? But either way, allowed address of * should allow any1 to connect right? by the way I put the crossdomain.xml file in the root folder of the web server also, still doesn't make a difference.
Be so happy to solver this issue once and for all.
The <AllowedAddress> you mentioned in the message is related to the admin tool.
You can specify any number of IP addresses that are allowed to connected with the admin tool to the server.
If you pass a list of IPs, only those addresses only will be accepted as admins (provided that they know the logina and password).
In other words you have 3 levels of security for the admin too:
1 - username and password must be known
2 - password is encrypted, so sniffing will fail
3 - you can give access only to trusted IP addresses
hope it helps
You can specify any number of IP addresses that are allowed to connected with the admin tool to the server.
If you pass a list of IPs, only those addresses only will be accepted as admins (provided that they know the logina and password).
In other words you have 3 levels of security for the admin too:
1 - username and password must be known
2 - password is encrypted, so sniffing will fail
3 - you can give access only to trusted IP addresses
hope it helps
-
- Posts: 32
- Joined: 09 Feb 2006, 12:12
hey
hey
Can anyone tell me why the following directive wouldn't work in smartfox?
<AutoSendPolicyFile>true</AutoSendPolicyFile>
<PolicyAllowedDomains>
<AllowedDomain>mydomain.com</AllowedDomain>
<AllowedDomain>xxx.xxx.xxx.xxx</AllowedDomain>
</PolicyAllowedDomains>
I even load ti explicitly in the flash file. Is there asomething I'm doing wrong? The doc says smarfox should let you connect to the domain(s) that are entered as shown above. Any idea why my client still can't connect to the server?
Can anyone tell me why the following directive wouldn't work in smartfox?
<AutoSendPolicyFile>true</AutoSendPolicyFile>
<PolicyAllowedDomains>
<AllowedDomain>mydomain.com</AllowedDomain>
<AllowedDomain>xxx.xxx.xxx.xxx</AllowedDomain>
</PolicyAllowedDomains>
I even load ti explicitly in the flash file. Is there asomething I'm doing wrong? The doc says smarfox should let you connect to the domain(s) that are entered as shown above. Any idea why my client still can't connect to the server?
The doc says smarfox should let you connect to the domain(s) that are entered as shown above.
It's not smartfox that will let you connect to a certain domain, it's the flash player The flashplayer sandbox, by default, does not allow connection outside the current domain.
I've tested your IP address with a simple telnet connection and I see the server responding, so it seems well configured.
Maybe the client you're trying is behind a firewall.
If your test client is available on the web send us the url (privately if you prefer) and we'll check it from here.
-
- Posts: 32
- Joined: 09 Feb 2006, 12:12
Yup, I know. problem is, it won't work! I've done all the right things.
Here's the client:
http://ppoker.xuqa.com/smartfox
I've entered the following into config.xml of s smartfox server, which is also running on this same machine.
<PolicyAllowedDomains>
<AllowedDomain>ppoker.xuqa.com</AllowedDomain>
<AllowedDomain>207.150.187.153</AllowedDomain>
</PolicyAllowedDomains>
the ip is the ip of the host. It STILL doesnt work. It does work for a parallel setup I have at poker.xuqa.com. The same exact setup. Only difference is there's no PolicyAllowedDomains entry in the config file.
Here's the parallel setup:
poker.xuqa.com/smartfox
username: demoUser@xuqa.com
password: password
Thanks for your help
Here's the client:
http://ppoker.xuqa.com/smartfox
I've entered the following into config.xml of s smartfox server, which is also running on this same machine.
<PolicyAllowedDomains>
<AllowedDomain>ppoker.xuqa.com</AllowedDomain>
<AllowedDomain>207.150.187.153</AllowedDomain>
</PolicyAllowedDomains>
the ip is the ip of the host. It STILL doesnt work. It does work for a parallel setup I have at poker.xuqa.com. The same exact setup. Only difference is there's no PolicyAllowedDomains entry in the config file.
Here's the parallel setup:
poker.xuqa.com/smartfox
username: demoUser@xuqa.com
password: password
Thanks for your help
-
- Posts: 32
- Joined: 09 Feb 2006, 12:12
oh no
custom login is set to it's default, which is false.
Any idea what else it might be?
Any idea what else it might be?
-
- Posts: 32
- Joined: 09 Feb 2006, 12:12
Return to “SmartFoxServer 1.x Discussions and Help”
Who is online
Users browsing this forum: No registered users and 88 guests