[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gcl-devel] Re: Server sockets with GCL?
From: |
Jeff Dalton |
Subject: |
[Gcl-devel] Re: Server sockets with GCL? |
Date: |
Wed, 05 May 2004 17:24:16 +0100 (BST) |
User-agent: |
IMP/PHP IMAP webmail program 2.2.8 |
Quoting Chris Hall <address@hidden>:
> > What I'm confused about is how to take the results obtained from
> > calling ACCEPT-SOCKET-CONNECTION and derive a pair of streams.
>
> I'd like to do this, too, but after looking at the existing C socket
> code that I can find in GCL and reading what Camm has to say, it seems
> it some work needs to be done on the C side. I am, when I can spend
> the time, learning what I can about C socket programming on Linux.
When I did socket stuff in GCL in order to write an HTTP server,
I wrote a function called accept-socket-connection that returned
an df (ie, an int), and I wrote something called fdopen that
would return a Lisp input or output stream. Then
(defun socket-connection-stream (s)
(let ((fd (accept-socket-connection s)))
(make-two-way-stream
(fdopen fd :input)
(fdopen fd :output))))
fdopen was named after the C procedure that makes a FILE from an fd.
I could then do normal I/O with the resulting stream.
All of this was reasonably straightforward to do using the C
interface.
I'm not sure how freely available my code is, though it's supposed
to become open source as part of O-Plan (an AI planning system)
at some point.
However, I'd be ahppy to try to help other people with such
things where I can.
BTW, is there any documentation for the GCL C interface.
My copy of the KCL manual was destroyed in a fire, and I
couldn't find anything on-line.
-- Jeff
- [Gcl-devel] Server sockets with GCL?, tdjohns1, 2004/05/04
- [Gcl-devel] Re: Server sockets with GCL?, Chris Hall, 2004/05/05
- [Gcl-devel] Re: Server sockets with GCL?,
Jeff Dalton <=
- Re: [Gcl-devel] Re: Server sockets with GCL?, Camm Maguire, 2004/05/06
- Re: [Gcl-devel] Re: Server sockets with GCL?, Helmut Eller, 2004/05/06
- Re: [Gcl-devel] Re: Server sockets with GCL?, Jeff Dalton, 2004/05/06
- [Gcl-devel] Re: Server sockets with GCL?, Chris Hall, 2004/05/07
- Re: [Gcl-devel] Re: Server sockets with GCL?, Dennis Decker Jensen, 2004/05/08
- [Gcl-devel] Re: Server sockets with GCL?, Chris Hall, 2004/05/10
- Re: [Gcl-devel] Re: Server sockets with GCL?, Dennis Decker Jensen, 2004/05/11
- Re: [Gcl-devel] Re: Server sockets with GCL?, Michael Koehne, 2004/05/06