1

I have to ask this because Flash/Flex is driving me nuts.

I am using the ServerSocket class in an Air environment on the desktop to setup a server that listens for mobile clients (Air for mobile). I tested this in debug mode (Flash Builder) and everything worked fine: ServerSocket to listen to 127.0.0.1:8889 (local machine) --> Connection to 127.0.0.1, port 8889 setup on the mobile (local machine) --> check.

So I installed the app on my android smartphone (WiFi connected) and entered the machines IP and port but I couldn't get connected: ServerSocket to listen to 127.0.0.1:8889 (local machine) --> Connection to 192.168.2.101, port 8889 setup on the mobile --> not working.

Just for testing I setup an easy Java server, connected to the Java SocketServer and voilà it worked. So I assume that the problem lies within the SocketServer class of the Air environment.

Do you have any ideas? Would be glad if you guys could help.

Happy new year!

ketan
  • 19,129
  • 42
  • 60
  • 98
dergestalt
  • 41
  • 5
  • There is some small progress but I can't figure out how to solve this. Apparently the problem comes from the different namespaces. The Java server shows up in the listening ports as `*:8888`. In contrary the Air server calls himself `ereg.adobe.com:4321`. I suppose that means that only connection from the domain `ereg.adobe.com` are accepted. What do you think? – dergestalt Jan 01 '12 at 12:52

2 Answers2

0

ServerSocket is not supported on mobile.

0

1) You can verify with "netstat" command on Windows/Linux that your server is indeed listening at the port. Can you telnet to that port from another machine, using PuTTy or native "telnet"? Does you firewall (on Windows/Linux, doesn't matter) allow connections to that port?

2) Do you handle socket policy requests? For example with my Perl script or my Apache module (the script will run on Windows/Linux).

Good luck :-) I run a small multiplayer card game in Flex + Perl and had to take many hurdles...

Alexander Farber
  • 21,519
  • 75
  • 241
  • 416