Error #2048

Post here your questions about the Flash / Flex / Air API for SFS2X

Moderators: Lapo, Bax

Post Reply
davidp
Posts: 9
Joined: 13 Jan 2012, 14:10
Location: slovenija
Contact:

Error #2048

Post by davidp »

First I must apologize for 1st post being a help call, but I can't help myself at this one.

So, I've been messing around with SFS (very good product I must say!) and I made this small platforming game which can be played online. All fine. I've connected to my localhost server @ 127.0.0.1 with 3, 4 flash instances running, everything worked out perfectly (real smooth, in total contrast of Flex p2p capabilities), but then I ran the game from another in-lan computer and got connection failure problem - error #2048.

Now the game sits on top of wamp server on my localhost (location where SFS is also ran, that's why my connection strings in game are directed to 127.0.0.1) and anyone who wants to play it, connects to my comp via IP address in browser. Page loads, game loads, but then fails on connection. This only happens if I run it from another computer.

After some research I found out that this could be Flash native issue? Any suggestions what I should do to overcome it?

I'm really frustrated about it, because game plays real smooth on localhost and I'd die to try it over lan, but this is just stupid, I can't come up with anything solid to help me.

Thanks in advance.
A51Integrated
Posts: 240
Joined: 03 Jan 2012, 19:55
Location: Toronto, Canada
Contact:

Post by A51Integrated »

First thing to try is to make sure the ports are accessible from the LAN. Make sure you have your firewall settings set correctly and telnet to the port from another system. If the ports are open, then you should at least get a response fro the server.
A51 Integrated
http://a51integrated.com / +1 416-703-2300
davidp
Posts: 9
Joined: 13 Jan 2012, 14:10
Location: slovenija
Contact:

Post by davidp »

Hm, my firewall was actually completely shut down because clients won't connect to WAMP server in first place (didn't really bother with opening ports, so I shut down the whole thing), so firewall can't be the problem.
A51Integrated
Posts: 240
Joined: 03 Jan 2012, 19:55
Location: Toronto, Canada
Contact:

Post by A51Integrated »

In that case, make sure the server is bound to its private IP and the client is using the servers public ip (in the config XML). Verify that that your ports are correctly set and for the sake of elimination, telnet to the servers ip and port from a remote system.
A51 Integrated
http://a51integrated.com / +1 416-703-2300
davidp
Posts: 9
Joined: 13 Jan 2012, 14:10
Location: slovenija
Contact:

Post by davidp »

Hm, yea, but the SWF file and the html page it resides on are both on the same computer as SFS server, meaning 127.0.0.1, or am I missing something?

Anyway if I change my XML conf. to:

Code: Select all

<SmartFoxConfig>
	<!-- Mandatory Settings -->
	<ip>10.6.0.36</ip>
	<port>9933</port>
	<zone>GameLobby</zone>
	<debug>true</debug>
	<httpPort>8080</httpPort>
</SmartFoxConfig>
IP being my LAN IP I get this error:
## SocketError: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2031: Socket Error. URL: 10.6.0.36"]
Connection Failure: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2031: Socket Error. URL: 10.6.0.36"]
Which is a totally new error :(
A51Integrated
Posts: 240
Joined: 03 Jan 2012, 19:55
Location: Toronto, Canada
Contact:

Post by A51Integrated »

Even though the files are hosted on the same server, the client downloads the SWF and XML files to the local client computer and tries to connect to the server configured in the XML. So your client XML needs to have the public IP of the server since it's coming in from the outside.

The error you've mentioned is a socket connection error, but that should be the correct IP within your LAN (if that's the server IP).

What do you get from the client machine when you telnet to the server's IP and port?
A51 Integrated
http://a51integrated.com / +1 416-703-2300
davidp
Posts: 9
Joined: 13 Jan 2012, 14:10
Location: slovenija
Contact:

Post by davidp »

Hm, I can't reach the server via telnet 10.6.0.36 9933, it says host is unreachable. Ping works just fine. If I telnet 127.0.0.1 9933 something happens - carret blinks in CMD and that's it, I guess that works.

But the problem is that if I put PUBLIC ip in xml I can't even connect locally, which works fine when xml's ip is 127.0.0.1
Last edited by davidp on 13 Jan 2012, 17:37, edited 1 time in total.
A51Integrated
Posts: 240
Joined: 03 Jan 2012, 19:55
Location: Toronto, Canada
Contact:

Post by A51Integrated »

Well, that's the issue. Locally it will work because you're behind everything and using the loopback / localhost address. If you try the SWF locally but use the public IP, it will try to go out and back in, but if the port on that IP is blocked (by something) then it won't be able to connect.

You'll need to figure out what it is that's blocking that port from the outside world.
A51 Integrated
http://a51integrated.com / +1 416-703-2300
davidp
Posts: 9
Joined: 13 Jan 2012, 14:10
Location: slovenija
Contact:

Post by davidp »

Oh, I see. I'll try to find a solution and then come back :D
davidp
Posts: 9
Joined: 13 Jan 2012, 14:10
Location: slovenija
Contact:

Post by davidp »

Yep, port 9933 is reachable and all, but the damn thing won't work no matter what.

EDIT: You know those feelings when you work on something and spent xy time finding solution to that particular nasty bug and whatever you do you can't solve it, until it strikes you, moment of sheer brilliance but in the same time you also feel a bit stupid (to say at least)?

This:
Post-installation tasks

After the installation your SFS2X instance is ready to be started. By default the server binds exclusively the localhost IP address (127.0.0.1) on the default TCP port 9933. This will enable you to immediately test the server locally without worrying of security problems. Only your local machine will be able to talk to the server initially.
more here: http://docs2x.smartfoxserver.com/Gettin ... stallation

I've forgot to add outside IP to the server config, that's why I couldn't connect. O EM GE :oops:
Post Reply