gcl-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gcl-devel] Re: Server sockets with GCL?


From: Chris Hall
Subject: [Gcl-devel] Re: Server sockets with GCL?
Date: Sat, 08 May 2004 01:40:43 -1000
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.2 (gnu/linux)

Camm Maguire <address@hidden> writes:

> Greetings!
>
> OK, for this 'quick and dirty':
>
> 1) Apply the patch below
> 2) In GCL: (defun foo (x) x) (setq s (si::socket 1919 :server 'foo))
>       (setq q (si::accept s))
> 3) In some other window, either netcat or telnet localhost 1919
> 4) IN GCL: accept should return with a cons containing a two way
>    stream
> 5) In other window, type hello
> 6) In GCL: (read-line (car q)) ; should give "hello"
> 7) In GCL: (format (car q) "there~%")
> 8) there should appear in other window.

Woohoo!  Works for me, thanks *sooo* much Camm!  *Now* I can play. 8-D

>
> Not quite ready to commit this as the dummy server function is pretty
> ugly.  I think the original intent might have been to define handlers
> via the SIGIO-INTERRUPT symbol and the SET-SIGIO-FOR-FD function.

In this case it appears that 'dummy'=='do nothing'?  I defined a
function to just print a string to *standard-output*, but it doesn't
seem to have run.  Not that this bothers me in the least for now.

>
> Do we want to specify a server function in this case, and if so, what
> do we want it to do and when?
>

Well, if GCL was to go with the select() model, mightn't this be the
logical place for an event handler, a la the SIGIO mentioned above?

For the sake of discussion, and keeping in mind that I'm a Lisp n00b,
would it be appropriate in the case of select() and the server function
if when called the the server function was passed a keyword to indicate
the event, e.g., :SOCKET-CONNECTION-LOST?

Is there anyway to extract the socket and/or fd from the two-way stream?
In case I'd like to mess about with select() on my own?  I can't seem to
find a function that does that.

Thanks again, and Aloha,
+Chris

-- 
Courage is doing what you're afraid to do. There can be no courage
unless you're scared.
-- Eddie Rickenbacker (1890 - 1973)

Attachment: pgpwI_6hnSYfs.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]