Beesnest - Personal Application Server |
Home | Documents | Downloads/Code | Test It | About | Contact Me |
The system is built from 5 main modules: Network, Files System, Login and User Status System, Script Processing System and the Request Processing System (Main Thread or Process Thread or Connection Thread).
The Network layer has a Server Socket that listens to incoming requests. On a new request, after checking the work load, it opens a new thread with a new Socket object that is connected to the client. The socket has a Request and Response objects, that do the HTTP protocol abstraction.
A new request from the Internet, gets a new Connection Thread object to be created (Process Thread). This is the object that do most of the work processing the request. It first reads the request, and assemble the response page using the Files Manager. Then checks if the user is logged in or need to log in, and, if the user is logged in, it gets the user saved data from the Login Manager. In the end it process the scripts on the response page (if any), and send the response to the client.
The Connection Thread object got the user Engines Set and Adapters Set from the login system (if the user is logged in). It checks which script engine(s) it needs to use for the scripts that on the response page (response buffers list) and gets the script engine(s) from the Engines Bank. The Engine Bank may create a new engine, or use a saved engine that is in the user's Engines Set. The Script Engine process the script and returns the result buffer to the Connection Thread object. If in the script there are instructions to use an adapter(s), the engine gets the Adapter from the Adapters Bank, and executes these instructions on this adapter. Also here the adapter can be newly created, or come from the user saved Adapters Set.
Home | Documents | Downloads/Code | Test It | About | Contact Me |