Shop OBEX P1 Docs P2 Docs Learn Events
[Contest Entry] Propeller Dynamic Application Server — Parallax Forums

[Contest Entry] Propeller Dynamic Application Server

obrienmobrienm Posts: 65
edited 2010-12-11 05:54 in Accessories
Project: Propeller Application Server (PAS)
Project Log:
20101118: Enter Parallax Spinneret Embedded Web Server Design Contest and start as a committer on the open source server software stack
20101119: Go through several ways of powering the board
20101120: Review/use Timothy Swieter's W5100 driver and TCP Server demo
20101121: Modify TCP Server demo above to do an AJAX POC
20101122: Mostly Infrastructure: Triaging analysis issues, specifically AI3: dispatch mechanism and servlet cog pool, as well as reviewing recent changes by Roy, Bean and Rick/CassLan, setup google code/eclipselabs source control/project page (pending approval) so I can track versions/builds/modules and changes. Start Spin Server Tools project for external development code such as a SSP (HTML Spin Server Page) process tool that would generate Spin Servlets at design time for download to the SD card and used by the HTTPServer container.
20101124: rework/review requirements and design based on original proposal from Jan 2010 at
http://forums.parallax.com/showthread.php?t=119478


Purpose:
Provide server-side scripting support for dynamic HTML/XHTML/XML content.]
This project will proceed in at least 4 implementation phases.
1 - single-variable substitution
<html>...<body><b>A random #: <%=String.valueOf(Math.random())%></b>...</body></html>
compiles as
<html>...<body><b>A random #: 0.11873021385672677</b>...</body></html>
2 - multi-line code block(s) where the request http://spinserver:8080/app-name/script.html?tz-offset=5
and the script.html file stored on the SD card containing the HTML/JSP fragment below
    <b>Your timestamp is: 
    <% Calendar aCalendar = Calendar.getInstance();
            if(null != tz-offset) {
                aCalendar.add(Calendar.HOUR, Integer.parseInt(tz-offset));
            }
        out.println(new java.util.Date(aCalendar.getTimeInMillis()));
    %></b>
is compiled and written out the port 8080 client as
<b>Your timestamp is: Thu Nov 18 20:46:38 EST 2010</b>

3 - compiled class file inclusion – with flat namespace

4 - full EE library namespace compilation
All the above functionality including support for predefined and extended class hierarchies along with client-less applications using servlets, RMI/RPC object calls etc..
In this phase the server maintains long running processes that are independent of the clients where as in previous phases everything is session/transaction specific and uses temporary servlet classes.
We will optionally provide VM support for server-side process control, code generation, RPC/RMI remote objects, in-memory DB and other layers on top of the top level of the OSI application level stack.
This project will rely heavily on a multitude of lower level protocol drivers and application layers written by or in conjunction with other teams.
The initial primary goal of this project is to provide HTML only server-side scripting support. This would involve converting the following HTML file containing scripting code into an HTML dynamic page that may change state/content depending on what the embedded script does.
We will be providing a server side scripting API that will provide limited enterprise level scripting on top of a virtual machine core. This support will be similar to what is provided in enterprise servers that run an application stack on top of their VM like the CLR for .NET and the JVM for JEE. Since the Spinneret is designed as a server instead of a client device like most embedded network devices like smart phones – we will be adding additional enterprise capability on top of client capability like what ships in Java ME.
Examples of VM based implementations that run on embedded devices are the RIM Blackberry, Android (Java based) implementations that run on Android OS devices or Windows CE/.NET embedded devices that run J#/C# on the CLR VM . This project will concentrate on server side implementations of the Java VM.
The capabilities of the PAS will be scoped and likely be a small subset of a traditional non-embedded application server stack. We will likely be limited by a combination of memory, speed and number of concurrent threads being served.
We could even start with enabling SPIN scripting in HTML pages by pre-compiling and running/interpreting SSP (Spin Server Page) code inside standard HTML-ignored <% %> bracket-percentage tags. This unit of work would be relevant to this project because the SPIN bytecode VM acts the same as a Java VM in that it is essentially a small ideal virtual processor with a stack and switch statement that emits machine code for each bytecode machine instruction (without GC, inheritance, polymorphism and classLoader extensions)
In this project we will not be providing “client-side” scripting support like JavaScript, VBScript that manipulate the DOM of the HTML page after it is sent to the client – these domains are part of the browser on that client. We may however provide an interface for the XMLHttpRequest AJAX client object that is used to asynchronously request XML data without going through the Get/Post mechanism . We will likely get this capability for free either from the Web or RMI/RPC containers.
I am also thinking we may need 2 versions of the source.
1) Full version that utilizes as much as possible the concurrent nature of using 7 of the 8 cogs for the web server (minus 1 cog for user hardware control)
2) Minimum version that attempts to implement IP in as small a footprint as possible 1-2 cogs - leaving most of the propeller chip available for user implementations that may need 6-7 cogs themselves.

Audience:
Server-side web developers

thank you Parallax and WIZnet.

The photo of the Spinneret below is my current development environment - The propeller chip is wireless only because it has it's own wireless router for now.


/Michael O'Brien
Ottawa

Comments

  • obrienmobrienm Posts: 65
    edited 2010-11-18 13:42
    Affilliated/Peer-Projects:
    SP1: WIZnet W5100 Parallel Driver (Brilldea_W5100_Indirect_Driver_Ver006.spin headed by Timothy Swieter of Brilldea)
    http://obex.parallax.com/objects/615/
    SP2: SD card driver (to be named - likely Kye's driver)
    or Tomas Rockiki http://obex.parallax.com/objects/92/
    SP3: TCP/IP transport driver (based on Brilldea_W5100_TCP_Server_Echo_Demo_indirect_Ver001.spin by Timothy Swieter of Brilldea)
    http://obex.parallax.com/objects/download/aux/82/
    SP4: DHCP driver (DHCP.spin headed by Roy Eltham)
    http://forums.parallax.com/showthread.php?t=127107
    SP5: HTTP/Web Server container (to be named)
    It will be based of Timothy Swieter's HTTP demo http://obex.parallax.com/objects/download/aux/86/ from http://obex.parallax.com/objects/615/
    SP5.1: Dispatch control with request/response forwarding
    SP5.2: MIME type management
    SP5.3: Admin console screen/server-port
    SP10: VM JIT/Interpreted (JVM or .NET CLR VM) (to be named)
    SP10.1: ANSI C compiler
    SP11: Class Loader process (to be named)
    SP12: GC – garbage collection for VM (optional – to be named)
    (Instead of using object pooling)
    SP13: Thread management process for VM (optional – to be named)
    SP14: Caching process – L1 and L2 (optional – to be named)
    SP21: RPC/RMI/(EJB-unlikely) Server container (to be named)
    SP22: SOAP/WS service (medium optional – to be named)
    SP23: JNDI DB/Object naming and directory lookup service (to be named)
    SP30: In-memory DB (optional – to be named)
    SP31: JPA/ORM DB persistence provider (optional - to be named)
    SP32: OXM persistence provider (object to XML ) (optional - to be named)
    SP33: HTML/XML parser (to be named)
    SP40: Runtime JMX MBean (management beans) server (slightly optional – to be named)
    SP51: Clustering/Grid Service (very optional – to be named)
    SP52: TLS Security implementation for HTTPS (optional – to be named)
    SP60: HTTP Client (as in the server acts as an HTTP robot and downloads content)

    Parent Projects:
  • obrienmobrienm Posts: 65
    edited 2010-11-18 13:43
    Requirements:

    R1: Dispatch control for servlet/spinlet threads
    R1.1: Request/Response/Session/Application/Server implicit variable access/control
    R1.2: URLEncode/URLDecode
    R2: Content Management (FTP or Web-based)
    R2.1: Flat-File database
    R2.2: Remote Access to file system
  • obrienmobrienm Posts: 65
    edited 2010-11-18 13:43
    Use Cases:

    Use Case partitioning criteria:
    - client/robot request
    - new/returning client session ID
    -

    UC1: Connection
    UC1.1: Auto connect to router and receive DHCP address
    UC1.2: Auto connect to router with static IP
    UC1.3: Auto connect to PC directly with default static IP 192.168.0.100 with direct Cat5 cable
    UC1.4: Auto connect to PC directly with default static IP 192.168.0.100 with crossover Cat5 cable (the W5100 should auto configure)
    UC2: static server content
    UC2.1: Serve static web page with form
    UC3: Dynamic server content
    UC3.1: client page requests XML content refresh for page sub-section
    UC4:
    UC10: Client browser control LED connected to J6 expansion pins
  • obrienmobrienm Posts: 65
    edited 2010-11-18 13:44
    Constraints:
    C1: Memory constraints
    L1: 2Kb RAM per processor * 8 shared with program space
    L2: 32Kb shared cache RAM (blocking/non-deadlock)
    L3: 32Kb upper part of 64Kb EEPROM
    L4: 2Gb SD Flash RAM
    C2: SPI SD card and SPI Comm driver usage is mutually exclusive
    C3: 4 maximum independent sockets
    C4: 16kb shared by rx/tx - but TCP/IP gaurantees packet delivery
    C5: IP fragmentation support is limited - this may affect large data sets or files as we may reach the MTU maximum
    C6: 8-bit parallel bus (16/32 bit data must be partitioned)
    C7: Cog # contraints - any SPIN drivers that use Assembly will use an extra cog
  • obrienmobrienm Posts: 65
    edited 2010-11-18 13:44
    Analysis:
    AI1: Why a VM?
    Priority: lowStatus: future

    A common virtual machine will allow us to run bytecodes that are compiled from any future web scripting language that we may support on the server – like JSP, ASP, Jython, Python or ....ISAPI (from early versions of Microsoft IIS)

    AI2: Leverage the SUN KVM for embedded devices
    Priority: lowStatus: future

    We could implement a version of the K virtual machine for Java ME devices. This is the smallest footprint port of the SE version that will fit in 128Kb of memory and run on at least 20 MHz devices. The KVM is written in ANSI C for portability.

    AI3: HTTP Server Dispatch
    Priority: critical Status: active

    The key to server responsiveness is keeping the server port 80/8080 listener process/object free from processing. We do this by spawning off a servlet thread/object (from a pool) to another cog as soon as we get a client request and immediately return control back to a waiting state for the next request. The spawned servlet cog then services its request, writes to the response and stores the session key for later re-requests. The cog is stopped and the cog id is returned to the dispatch pool.
    Using HTTP_Demo from Roy as a base for our static structure, it looks like we need to break up the initialization and packet capture loops in the Main function into public API functions and then create an interface that conforms to some spec like HTTPServlet for now so we can start writing the SSP to Servlet code and also separating server (service) implementation from user specific service/servlet api. We can start by using the older (1999) http://java.sun.com/products/servlet/2.2/ spec as a base.

    AI10: RPC (like DCOM)
    Priority: medStatus: future

    AI11: SOAP
    Priority: medStatus: future
  • obrienmobrienm Posts: 65
    edited 2010-11-18 13:45
    Feasibility Results:
    F1: Dynamic HTML response POC
    I didn't realize Timothy had a demo that simulated fetching an HTML page from storage. The demo works very well and got me thinking that before we tackle scriptlets inside HTML pages for dynamic content - we could start with the reverse a "Spinlet" class. In the JEE world a JSP page is an inside-out Servlet program. A servlet is a standard java program that is an implementation of an HTTPServlet. The server spawns off a thread (cog in our case) that runs an instance of the servlet for each user request. The servlet is passed 3 context objects on creation (request, response and session). The servlet reads parameters from the request, replies with HTML (or any XML/PDF etc... mime format) fragments by writing to response.out and uses the session to store state between requests for the same client (the client's request is cached with a unique key and assigned a timed session.
    So I think it should be simple to write up a spin file that can spawn off upto 7 "Spinlet.spin" objects in available cogs, set the mime type on the response, service the request, stop the cog and return the cog to the thread pool. This will just be a formalized version that adheres to any of the servlet API specs - we can pick the 1998 version to start with.
    http://en.wikipedia.org/wiki/Java_Servlet

    F2: AJAX POC : Repeated Timed Asnyc XML server response to XMLHttpRequest client object

    Google YouTube video of the Spinneret, Google Chrome browser, PST and use of the mouse-over and start/stop timer buttons for the AJAX POC

    http://www.youtube.com/watch?v=sNTTufau7ws

    This code change is only a proof of concept for an AJAX enabled client/server demo
    It requires proper file, request and response API handlers
    It also requires proper encapsulation modulues

    The AJAX design pattern is...
    1) the server serves out a html response containing both
    the client side JavaScript code and
    the HTML DOM processing code that displays dynamic XML data from the server
    2) the XMLHttpRequest object handles requests for XML data and parsing of the
    XML text response.
    It is up to the client-side developer to manipulate the DOM of the
    client page in response to what is recieved from an asynchronous GET request.
    In my case I respond both to mouse-overs and a timer request to send server requests.

    Currently this code works fine with Google Chrome (sometimes after a couple refreshes up to 10 sec after a propeller reset)
    The AJAX code works fine with IE from a desktop server but IE8 has issues with the line
    this._xmlHttp = new FactoryXMLHttpRequest();

    Code is a modification of the W5100 TCP Server Echo Demo by Timothy Swieter
    http://obex.parallax.com/objects/615/
    http://obex.parallax.com/objects/download/aux/82/
    Brilldea_W5100_TCP_Server_Echo_Demo_indirect_Ver001.spin
    http://forums.parallax.com/showthread.php?t=127181

    STREngine needs to remove the leading space for decimal parameters.
    Code/suggestions from Roy Eltham and Ultralazer.
    I still need to incorporate GET parameter parsing from Bean (I currently hardcode the URL) in
    http://forums.parallax.com/showthread.php?t=127301
    The SD card driver wrapper code from Roy for Kye's driver needs to be incorporated into the stack
    http://forums.parallax.com/showthread.php?t=127298
    and video pending.
  • obrienmobrienm Posts: 65
    edited 2010-11-18 13:46
    Design/Design Issues:

    DI1: Servlet/Spinlet dispatch(cognew) control
    DI2: Where to store the session id for new or returning client requests
    DI3: Defaults? keep-alive for the session, dhcp before static,...
    DI4: data pass through
  • obrienmobrienm Posts: 65
    edited 2010-11-18 13:46
    Implementation/Development/Building:


    Debugging:
    - We need a step debugger with variable inspection.
    http://propeller.wikispaces.com/Programming+in+C+-+Catalina
    or
    http://hannoware.com/viewport/
    - A way to update/download to the SD card "in-place" is needed so we don't remove/insert the card endlessly during development

    Prototyping:
    - Offline development using a non-embedded webserver may be usefull when developing the layout for example of a web page - or prototyping form handling. The following tutorials on most of the major App servers (that contain an HTTP web containter - usually Apache) are a quick start. You may just want to install Apache and/or Tomcat.
    http://wiki.eclipse.org/EclipseLink/Examples/JPA#Application_Server_Tutorials

    Code Diffs
    - Beyond Compare by Scooter Software http://www.scootersoftware.com/
  • obrienmobrienm Posts: 65
    edited 2010-11-18 13:47
    Testing:

    Specifications/Standards:
    XHTML 1.0 (2000) / HTML 4.0 http://www.w3.org/TR/html/
    XHTMLBasic (OBC) http://www.w3.org/TR/xhtml-basic/
    - however this is the domain of the client (we do not know who our client will be but we should be pushing XHTML 1.0/HTML 4.0 at least
    HTTP 1.1 http://www.w3.org/Protocols/rfc2616/rfc2616.html
    Servlet 1.2 (supports HTTP 1.1)
    Servlet 2.3 and JSP 1.2 http://www.jcp.org/en/jsr/detail?id=53
    Soap 1.2 http://www.w3.org/TR/soap/

    References:
    SD Card Tutorial from Propeller forum
    http://forums.parallax.com/showthread.php?t=127364
    WIZnet W5100 chip at SparkFun
    http://www.sparkfun.com/products/9471
    Spinneret Web Server board at Parallax Inc.
    http://www.parallax.com/Store/Microcontrollers/PropellerDevelopmentBoards/tabid/514/ProductID/710/List/0/Default.aspx?SortField=ProductName,ProductName
    10baseT
    http://en.wikipedia.org/wiki/IEEE_802.3
    100baseT
    http://en.wikipedia.org/wiki/802.3u
    WIZnet datasheet version to 1.1.8
    http://www.sparkfun.com/datasheets/DevTools/WIZnet/W5100_Datasheet_v1_1_8.pdf
    WIZnet datasheet version to 1.2.2 (without 1.1.7)
    http://www.parallax.com/Portals/0/Downloads/docs/prod/prop/W5100Datasheetv1.2.2.pdf
    PINK UDP/FTP/HTTP server
    http://www.parallax.com/Store/Accessories/CommunicationRF/tabid/161/CategoryID/36/List/0/SortField/0/Level/a/ProductID/40/Default.aspx
  • obrienmobrienm Posts: 65
    edited 2010-11-18 13:47
    Source Control:
    - Versioning & check-out/commit capabilities would be helpfull but with way too much overhead. The top sticky thread is a good source repository link for now with the OBEX for later formal modules.
    - However I find it more efficient to work with the following tools as the API progresses and we need to track changes/bugs
    1) bug tracking - aka BugZilla
    2) shared code repository checkin/out - aka CVS
    3) change tracking/diff control - aka Fisheye
    4) automated build tools - ant
    5) email change tracking notifications
    6) code reviews/results
    7) regression test results
    8) IDE integration of all above (eclipse.org Eclipse 3.5 for Java or C/C++)
    Therefore I have started the following eclipselabs project site on Google Code that uses the MIT license - what I need to do is get this external repository for use only during development approved.
    http://code.google.com/a/eclipselabs.org/p/spin-server-tools/
    http://svn.codespot.com/a/eclipselabs.org/spin-server-tools/trunk/
    http://eclipse.org/org/foundation/eclipselabs/guidelines.php
  • obrienmobrienm Posts: 65
    edited 2010-11-20 19:11
    Update:
    Here is a minor proof of concept to demonstrate an AJAX design pattern. I have slightly modified Timothy's HTTP Server demo so that a hardwired HTML page containing javascript utilizing the XMLHttpRequest can manipulate the DOM when mouse-over or timer event occurs.
    Note: this is different than puting a periodic refresh on the page. The ajax object connects asynchronously to any URL back to it's server and renders XML data on any part of the DOM that the javascript code wishes to modify - without doing a full get/post for the whole page.

    The Spinneret code in this case acts as both the dispatch and XML hosting servlets.

    This code change is only a proof of concept for an AJAX enabled client/server demo
    It requires proper file, request and response API handlers
    It also requires proper encapsulation modulues

    Google YouTube video of the Spinneret, Chrome browser, PST and use of the mouse-over and start/stop timer buttons for the AJAX POC

    http://www.youtube.com/watch?v=sNTTufau7ws

    The AJAX design pattern is...
    1) the server serves out a html response containing both
    the client side JavaScript code and
    the HTML DOM processing code that displays dynamic XML data from the server
    2) the XMLHttpRequest object handles requests for XML data and parsing of the
    XML text response.
    It is up to the client-side developer to manipulate the DOM of the
    client page in response to what is recieved from an asynchronous GET request.
    In my case I respond both to mouse-overs and a timer request to send server requests.

    Currently this code works fine with Google Chrome (sometimes after a couple refreshes up to 10 sec after a propeller reset)
    The AJAX code works fine with IE from a desktop server but IE8 had issues with the line
    this._xmlHttp = new FactoryXMLHttpRequest();

    Note: One of my spinneret servers refuses to service get requests - using this code - it pings and registers the request fine. (20101121 update: on one of my wireless routers one of the spinnerets has issues with a reserved static IP, on the other same DIR-615 router using the previously DHCP assigned address allows the Spinneret to respond). The issue is router related - not Spinneret related.


    Code is a modification of the W5100 TCP Server Echo Demo by Timothy Swieter
    http://obex.parallax.com/objects/615/
    http://obex.parallax.com/objects/download/aux/82/
    Brilldea_W5100_TCP_Server_Echo_Demo_indirect_Ver00 1.spin
    http://forums.parallax.com/showthread.php?t=127181

    STREngine needs to remove the leading space for decimal parameters.
    Code/suggestions from Roy Eltham and Ultralazer.
    I still need to incorporate GET parameter parsing from Bean (I currently hardcode the URL) in
    http://forums.parallax.com/showthread.php?t=127301
    The SD card driver wrapper code from Roy for Kye's driver needs to be incorporated into the stack
    http://forums.parallax.com/showthread.php?t=127298
    and video pending.
  • CassLanCassLan Posts: 586
    edited 2010-11-21 09:13
    obrienm,

    I hope you dont mind me replying on this thread, I'm not sure if this is only for your status updates on the project, if you mind let me know I will remove.

    I think your idea is just great. I use ASP and VBScript <% %> pretty much weekly...I think your project is exactly whats going to make the spinneret extremely usable for many, since they will be able to use pre-existing jsp/asp code.

    The SSP name is great too. If this was available right now, I would be flying with uploading files to the SD card, editing HTML via the Browser and some more.

    I made a dynamic page already that lists the files off the SD Card, and I'm concerned about how much time many will spend to do something like this before we have a standard in place that would allow users to drop the dynamic part into the served file to be interpreted by the server, rather than coding the dynamic page directly into the server.

    I also had a chance to play with your AJAX demo...very cool!! These are things that will make status screens extremely powerful, not having to refresh.

    Looking forward to more :)

    Rick
  • obrienmobrienm Posts: 65
    edited 2010-11-21 12:04
    Casslan,
    The more ideas the better!. We are early in the project so any type of experimentation and discussion is very good. I firmly believe in adhering to standards and API specifications and I also think we should start modularizing as much as possible our spin object hierarchy for reuse.
    Before delving into how we could support script sections inside html/xml documents I would like to get a basic dispatch mechanism working. This will necessarily involve spawning off requests to "spinlets" - (the spin equivalent of a java servlet) - so an "inside out JSP page".
    Note: the latest JSP specification no longer uses any proprietary <% %> tags and has moved on to all XML - so the JSP page becomes a fully parseable XML document and can be passed to parsers and have regular expressions executed on it. In our case we may need to stick with older more-easier-to-implement versions of these specs.

    Your post also made me remember XSLT and the browser-based processing language it supports - we should look at different renderers such as SVG.
    Keep the proof of concepts and demos coming - I liked your 2nd WYSIWYG browser page - nice!.
    Another thing to note is that is ok to have a couple implementations for each spec - as long as they target specific required functionality. I find as the layers get higher especially in everything that sits above the top application layer - there is more to choose from. For example in JEE6 we can choose from any of plain-servlets, JSP, JSF and other non-spec frameworks like Spring and even Struts for our Model-View-Controller layers. All of these frameworks sit basically on top of Telnet GET/Post as far I can see.

    Timothy also has a TCP client demo that I should look at, so we can investigate purely automated client/server applications between multiple Spinnerets or real JEE servers and Spinnerets. I would also like to see if we could support standard Web Services and SOAP http://www.w3.org/TR/soap/ This would allow the Spinneret to exchange XML data between "any" Server, DataSource or even Database that supports API's like JAX-RPC or JAX-WS (both .NET, SQL and JEE implementations).

    I will look at your and Roy's use of Kye's http://forums.parallax.com/member.php?u=52184 SD2.0_FATEngine.spin - I just need to find it on the OBEX and cannot really progress without the SD card driver object - so far I have http://forums.parallax.com/showthread.php?t=119467
    Found them on Roy Eltham 's page
    http://forums.parallax.com/showthread.php?t=127298
    Roy has written SD2.0_FATWrapper.spin for Kwabena's SD2.0_FATEngine.spin

    Looks like the file system may not be thread-safe (not a big issue) but should support 1 SD driver per cog.

    thank you CassLan and Roy.
    /michael
  • CassLanCassLan Posts: 586
    edited 2010-11-21 13:08
    obrienm wrote: »
    Keep the proof of concepts and demos coming - I liked your 2nd WYSIWYG browser page - nice!.

    Yes I agree!! Just to be clear, its not something I wrote:

    http://unverse.net/whizzywig-cross-browser-html-editor.html

    Its free, and very cool. In the end it will POST data back to a given destination with a variety of formatting options.

    Since we don't have any POSTing ability yet to my knowledge, I'm going to work first on the simpler one, basicly just a big text box, and use GET, but I think this will only work for very small files. I'm not sure, I will try :)

    Rick
  • obrienmobrienm Posts: 65
    edited 2010-11-22 19:26
    Roy, Bean, CassLan, Mike G, Gadgetman, OrbitCollector, Grimm, TinkersALot, UltraLazer, ElectricAye, ZapMaster, Zoopydogsit
    Stepping back a bit from coding, starting some infrastructure, and starting to think of overall design/analysis/use-cases. Reviewing HTTP_Demo and other changes before some proposal on a type of interface/wrapper code to use what is done and move out/extend the initialization and packet loop behaviour out of the main function - specific to dispatching of requests (my AI3 designate). I have looked over Roy's W5100 code and the SD wrapper and will still review Mike G's get/post code.

    Project Log:
    ...See full log on 1st post

    20101122: Mostly Infrastructure: Triaging analysis issues, specifically AI3: dispatch mechanism and servlet cog pool, as well as reviewing recent changes by Roy, Bean and Rick/CassLan, setup google code/eclipselabs source control/project page (pending approval) so I can track versions/builds/modules and changes. Start Spin Server Tools project for external development code such as a SSP (HTML Spin Server Page) process tool (runs on PC) that would generate Spin Servlets at design time for download to the SD card and used by the HTTPServer container - until we get runtime extraction of spin code out from inside an html file.


    AI3: HTTP Server Dispatch
    Priority: critical Status: active

    The key to server responsiveness is keeping the server port 80/8080 listener process/object free from processing. We do this by spawning off a servlet thread/object (from a pool) to another cog as soon as we get a client request and immediately return control back to a waiting state for the next request. The spawned servlet cog then services its request, writes to the response and stores the session key for later re-requests. The cog is stopped and the cog id is returned to the dispatch pool.
    Using HTTP_Demo from Roy as a base for our static structure, it looks like we need to break up the initialization and packet capture loops in the Main function into public API functions and then create an interface that conforms to some spec like HTTPServlet for now so we can start writing the SSP to Servlet code and also separating server (service) implementation from user specific service/servlet api. We can start by using the older (1999) http://java.sun.com/products/servlet/2.2/ spec as a base.


    ....in progress, I need to find another (likely text based) method of describing the UML design - this is a MS Visio diagram extract (I need to think in pictures) that i will likely stop using shortly.

    /Michael O'Brien
  • CassLanCassLan Posts: 586
    edited 2010-12-11 05:54
    Hey Obrienm, I've been totally swamped, but hows this coming?
    We really need this functionality :)
Sign In or Register to comment.