Arthur <art...@mathbrane.ca> writes:

| Hi Gaby ( and anybody else who's interested ),
| 
| I'm interested in changing the server socket in my web interface
| work to a C socket so as not to be tied to the GCL sockets which
| I currently use.

Hi Arthur,

   Many thanks for working on this.

| I've examined your package net.spad but notice you haven't yet
| implemented a server socket to listen for incoming connections.

Yes, that is correct.  The only reason I did not do that was that I
considered I would need some form of concurrent processing for the
server to be useful.  Either multithreading or process forking.
The former is a far dream (as GCL does not seem to have discovered it
yet) and also multithreading support across existing Lisp systems is,
ahem, a real challenge.  The other option was process forking.  I just
did not know whow the Lisp garbage collector would react to a fork
originating from a Lisp system.   

| The functionality in net.spad traces back to src/lib/sockio-c.c
| which makes calls to the standard glib sockets.  I notice there
| that there is a function that makes server sockets, namely
| 'open_server'. This function is set up to produce 2 servers, an internet
| domain and a local domain socket, however the internet domain code,
| which is what I want, is commented out.  When I uncomment it and try to
| build OpenAxiom I get some minor errors about undeclared variables.

'open_server' was an unsuccessful attempt (dating back prior to my work
on the FFI).

| I seek your advice on the best way to proceed.  Firstly do you plan, in
| the near future, to add a server socket interface in net.spad.  If
| not I'll work on doing so but do you think it best to use the code in
| sockio-c.c or, alternatively, use your Foreign Function Interface,
| 
| 
http://sourceforge.net/mailarchive/forum.php?thread_name=4AE60F68.5070309%40research.att.com&forum_name=open-axiom-help
| 
| and bypass the code in sockio-c.c?

I'll welcome any helping hand.  So, if you're taking on the server
socket I will try to help you with the FFI aspect.  As for a way to
proceed:

  (1) the FFI depends on the capability of the base Lisp runtime.
      Most specifically, if the base Lisp supports dynamic linking
      (e.g. SBCL, ECL, and some form of CLISP) then you can load
      your C library at runtime and gets things done without having to
      modify sockio-c.c.

      If your base Lisp is like GCL and does not understand shared
      libraries, then the best course of action is to augment
      sockio-c.c and the new capabilities.  Then the OpenAxiom core
      system will pick the definitions.

  (2) in either case, you can use the C functions directly in 
      Spad code through the FFI.  I recommend to do it that the
      Spad level instead of the Boot level because that way you
      don't have to know about Boot or Lisp.  The Spad compiler
      takes care of everything.


Hope that helps,

-- Gaby

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
open-axiom-devel mailing list
open-axiom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open-axiom-devel

Reply via email to