views:

432

answers:

2

My co-worker is challenged with taking user input in Flex and using that data to execute commands on a USB device. We figured we would need to have a socket server running on the machine in order to do this. We want to send objects with byte arrays etc, not just strings.

Is there anything out there that could help us? Do we need to write our own socket server, which I am afraid might take some time, or can we use any of the existing remote gateways like WebORB or FluorineFX and somehow use that to do the communication and the serialization perhaps by hosting them as a Windows service?

+2  A: 

Checkout Merapi (http://www.merapiproject.net/) Java-to-AIR bridge.

+1  A: 

A few different options here:

  1. Merapi (local socket server written in Java)

  2. Write your own socket server from scratch

  3. Write a Java applet and use ExternalInterface to communicate in both directions

I haven't used #1 but have heard good things about it. #2 is obviously a lot of work considering that #1 is already available for you. Either way, the end user needs to install the socket server which can be a hassle.

I've done #3 and it actually worked pretty well in that application. It would limit you to some extent in terms of the data types you can send. However if the applet is signed/trusted I think you could actually have it open a local socket server much like Merapi.

cliff.meyers