Committed to usocket trunk, thanks!
On Thu, May 21, 2009 at 23:27, Andrei Stebakov <lispercat(a)gmail.com> wrote:
> Hi Hans
>
> I did it with diff -c sbcl-before.lisp sbcl.lisp, hope that's what you
> asked.
>
>
> *** sbcl-before.lisp 2009-05-21 17:09:56.000000000 -0400
> --- sbcl.lisp 2009-05-21 16:46:55.000000000 -0400
> ***************
> *** 174,179 ****
> --- 174,180 ----
> . socket-type-not-supported-error)
> (sb-bsd-sockets:network-unreachable-error . network-unreachable-error)
> (sb-bsd-sockets:operation-timeout-error . timeout-error)
> + (sb-sys:io-timeout . timeout-error)
> (sb-bsd-sockets:socket-error . ,#'map-socket-error)
>
> ;; Nameservice errors: mapped to unknown-error
>
>
> Thank you,
> Andrei
>
> On Thu, May 21, 2009 at 5:11 PM, Hans Hübner <hans.huebner(a)gmail.com> wrote:
>>
>> On Thu, May 21, 2009 at 23:07, Andrei Stebakov <lispercat(a)gmail.com>
>> wrote:
>> > Yes, it works.
>> > Thank you,
>>
>> Can you send a context diff so that I can fix usocket for everyone?
>>
>> Thanks,
>> Hans
>>
>> _______________________________________________
>> tbnl-devel site list
>> tbnl-devel(a)common-lisp.net
>> http://common-lisp.net/mailman/listinfo/tbnl-devel
>
>
Hello,
I am investigating possibility of running FastCGI scripts with Lisp.
This is doable at least on SBCL and (recently, on trunk atm) Clozure
CL, since these implementations allow for creating a socket from file
descriptor as integer -- and FastCGI protocol includes the script
receiving a listening socket on FD 0 (stdin), which is a pattern
sometimes seen in UNIX world (e.g. inetd).
To get a socket from FD, I have to resort to using unexported functions
in conjunction with platform-specific calls:
(usocket::make-stream-server-socket
#+ccl (ccl:make-socket :address-family :internet :type :stream
:connect :passive :fd 0)
#+sbcl (make-instance 'sb-bsd-sockets:inet-socket :descriptor 0))
Is it possible to incorporate this usage pattern into usocket, and if
yes, how should I approach preparing the patch? I was thinking along
the lines of exporting MAKE-STREAM-SOCKET, MAKE-STREAM-SERVER-SOCKET,
and MAKE-DATAGRAM-SOCKET functions, making them accept either an
implementation-specific socket or integer file descriptor as first
argument, and adding relevant backend function for creating socket by
FD and element type. Would this be a correct approach, or would you
suggest another API?
Thanks,
Maciej.
--
Maciej Pasternacki -><- http://www.pasternacki.net/ -><-
http://www.3ofcoins.net/