1

I have a Flash client application, written in ActionScript, which uses the XMLSocket class to talk to the server device via TCP/IP, on port 5750. So for example, I can run the Flash client in a browser and connect to a server which is on the Internet.

Since recent versions of Android support Flash, I would expect this to work when we install the Flash client on an Android device. However, the connection attempt just hangs. I don't currently have any diagnostics on the client side, just the running Flash application. So we have no logs or standard error messages.

The server device is basically a black box, but it does seem clear that the server never gets the request from the client. This suggests that the client was unable to open the socket.

A basic Web search suggests that not much is known about this situation. Any thoughts about what's going wrong here?

For example, maybe XMLSocket just doesn't work in Android? Or Android blocks port 5750? Or Flash Player has some kind of sandbox or firewall limitations built in?

We've tried a couple of different Android devices running Android 2.2-2.3 and Android Flash Player 10-11. The client is written in ActionScript 2.

Hew Wolff
  • 21
  • 2

1 Answers1

2

This is probably a security settings problem.

I suppose your Flash client running on the Android device is not in the same domain as the server. Adobe's AS2 reference tells it all:

The XMLSocket.connect() method can connect only to computers in the same domain where the SWF file resides. This restriction does not apply to SWF files running off a local disk. (This restriction is identical to the security rules for loadVariables(), XML.sendAndLoad(), and XML.load().) To connect to a server daemon running in a domain other than the one where the SWF resides, you can create a security policy file on the server that allows access from specific domains.

Setting up a server to communicate with the XMLSocket object can be challenging. If your application does not require real-time interactivity, use the loadVariables() function, or Flash HTTP-based XML server connectivity (XML.load(), XML.sendAndLoad(), XML.send()), instead of the XMLSocket class. To use the methods of the XMLSocket class, you must first use the constructor, new XMLSocket, to create an XMLSocket object.

There are a couple of other related problems to your question, worth taking a look:

XMLSocket working in firefox but not IE

Flash client XMLSocket not connecting to server

Community
  • 1
  • 1
André Staltz
  • 13,304
  • 9
  • 48
  • 58