Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 626
  • Last Modified:

Socket in Flash SWF

Hi,

I have created socket swf application and I want to use it in a website to connect to the server and get data.

It's not working on SWF, it only work after I compile it to EXE.

How can I get socket to work with SWF?
0
Mohamed Abowarda
Asked:
Mohamed Abowarda
  • 6
  • 4
2 Solutions
 
Randy DownsOWNERCommented:
0
 
Mohamed AbowardaSoftware EngineerAuthor Commented:
It's now asking me for policy file, even after I added policy file it keep asking for it.
0
 
Randy DownsOWNERCommented:
Have you tried different browsers? It looks like some browsers may not support it.

1.Try Chrome and Firefox 3.x.

¿It doesn't work on Chrome:
It's likely an issue of your code or the server. Debug your code as usual e.g. using console.log.
¿It works on Chrome but it doesn't work on Firefox:
It's likely an issue of web-socket-js specific configuration (e.g. 3 and 4 below).
¿It works on both Chrome and Firefox, but it doesn't work on your browser:
Check "Supported environment" section below. Your browser may not be supported by web-socket-js.

Also you may want to different ports

policy file at port 843, modify the file to allow access to port 10081
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
Mohamed AbowardaSoftware EngineerAuthor Commented:
Please post XML file example for localhost, connecting to port 10000.

Thanks,
0
 
Randy DownsOWNERCommented:
Try this - http://wiki.mediaboxtraining.com/doku.php/flash:sockets_creating

// creation of the connection
var connection:XMLSocket = new XMLSocket("localhost", 10000);In the case where the address used is not specified upon instantiation, we can use the connect method:

// creation of the object XMLSocket
var connection:XMLSocket = new XMLSocket();
// connection to the socket server
connection.connect("localhost", 10000);
0
 
Mohamed AbowardaSoftware EngineerAuthor Commented:
I am using Socket not XMLSocket().

Now I only want it to work on the server, it still require the policy file.
I want policy file that will make it work on localhost post 10000.
0
 
dgofmanCommented:
You have to stream XML crossdomain format from your backend when you are using socket connection.
0
 
Mohamed AbowardaSoftware EngineerAuthor Commented:
@dgofman: I need XML file "crossdomain.xml" example that allow flash connection on localhost port: 10000.

I have tried to use several files and it doesn't work.
0
 
Mohamed AbowardaSoftware EngineerAuthor Commented:
I have resolved the problem by sending the policy XML from the server to the client.

Thanks all,
0
 
Mohamed AbowardaSoftware EngineerAuthor Commented:
I have found that I need to end the data streaming by specific char so the client will know that the policy sending is completed.

Since the problem is now resolved I am closing this question.
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 6
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now