The IBM i host servers
are TCP servers that serve clients via stream sockets. This fact allows any programming language that supports stream sockets to cooperate with the IBM i host servers. ActionScript 3.0 (the core programming language of Adobe Flash) supports client sockets and hence has the ability to work with the IBM i host servers. But since the security limitation of Flash, before connecting to a socket server a Flash program need to load a security policy file from the server.
The following are example steps to set up a TCP policy server that listens at a given port and provides policy files to Flash client programs.
- Compile pcysvr.c into an IBM i program object, for example called PCYSVR. After being runned, this example policy server will listen at port 55556, and send the content of a example policy file to any client connects to it.
- Run the policy server at your IBM i server. For example, you can simply submit it as a batch job to a subsystem using the SBMJOB (Submit Job) CL command. e.g.
SBMJOB CMD(CALL MY_LIB/PCYSVR) JOB(AS3PCYSVR) JOBQ(QBATCH)
Now you can run Flash programs linking with the AS3 classes provided by this subproject to utilize the functionalities exposed by the IBM i hsot servers. Enjoy your IBM i journey! :)