You probably want to use the socket classes:
In case there is any confusion, Flex / The Flash Player is a client side technology. I understand it can connect to a server and listen to a port for incoming events. But, I do not believe it can act as a server.
basically I need a 'flex/actionscript' version of the Java server shown at page 473 of the ActionScript manual
which allows my c++ socket app to talk to it.
Is this possible??
Thanks for your reply Jeffry,
Yes I need to know if it can act as a server???
I have looked at samples where it acts as a server for its own
but i need this same functionallity only for a c++ client.
it's impossible to act as a real server. In AIr there is a SocketMonitor for this.
You can connect to specific port on machine and send and recieve data.
So you can create only a workaround: create a listener in C# and create a connection from this listener to your flex application.
I would suggest you get a real server platform instead of trying to make Flex work as a server. ColdFusion, Java, and/or .NET should work easily with a Flex app, and I would suepcet you can write code to make the C++ client connect to any of those servers using the same protocols.
As best I understood it, the Localconnection class is different than a socket server. It just allows one SWF or AIR app to run code in another. Not my area of expertise though.
Thanks a lot for the replies. OK so now I know that I cannot get flex to act like a 'real' server on its own I will have to use a C# server program that I have already written.
Is it possible to 'embed' my flex program inside my c# windows application. I dont want the user to have to start up two programs (flex program and c# server). If I embedded my flex app in my server then only one program is needed.
I imagine you would have to embed one of the Flash players in your C# app.
It would be helpful if you could describe the functionality you are
trying to achieve and why you think a Flex app embedded in a C# app is
the best solution.
I want to explain you something related to SocketProgramming in Flex,
First me not sure are you going to User Flex/Air if you Use Air then not a problem but if you Use Flex then Problem raises.
- You Cannot Make a Flex Application as a Server what i mean is In our Socket Programming we will be having Client and Server right? so our flex application cant be a Server, It can act only as a client.
- If more amount of Data Is coming from Server to Client Flex application will be hanged-off, i faced this Problem eariler.
This is my application:
I have a client application that runs on a windows mobile PDA. This application needs to send data to a database on a PC. I am currently designing a flex application that will display this data using fancy 3d graphs and models.
My problem is that I need this application to act as a server so my client app can connect to it via sockets and send and receive data etc.
I have been told that flex cannot act as a server so I have quickly put together a C# windows application that allows my client (or several of them) to connect to and send data etc.
Now I wish to 'embed' my flex application in this C# application to make use of the fancy data display components (graphs etc).
Is this possible?
re:First me not sure are you going to User Flex/Air if you Use Air then not a problem but if you Use Flex then Problem raises.
why is there a problem with Flex and not with Air, please explain as I'm quite new to these technologies..
Why Because Using Flex Application you cannot Create a Server (what i mean is Server Socket ) but using AIR We can Create ( Air is a StandAlone Application But Flex is a Web Application.)
You can Make Flex Application as a Client But not as A Server.
Do you need your application to be run in Web or do you want it as a Standalone Application , If you want your Application to be Standalone then go For AIR.
Yes my application will be standalone on the desktop.
I am confused.......
From my reading, a flex application can be build for AIR, but you are telling me that I cannot create a server using flex, but I can using AIR.
So are you saying that if I forget about flex altogether I can just use the AIR SDK to create a standalone server program?
Then go For AIR Create Air applications and then Your Air Application can be Server.
Thank you very much for all your help
Does anyone know of any good tutorials/links/samples to AIR programs that act as servers?
Based on what I understood from the posts above, it seems you're heading the wrong way.
You are saying you want to connect from a mobile device to flex/air app and then access some datasources. To me it sounds like you're making a connection from client to client when in fact what you would need is a client-server architecture. To achieve this, write the server with language meant for that (Java, C#, python, etc) and write different clients for the server (Air, Windows Mobile, etc).