[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gcl-devel] Re: Using sockets in gcl
From: |
Chris Hall |
Subject: |
[Gcl-devel] Re: Using sockets in gcl |
Date: |
Sun, 02 May 2004 20:50:33 -1000 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) Emacs/21.2 (gnu/linux) |
Marc Mertens <address@hidden> writes:
> Hello,
>
> I want to use sockets to communicated with a server application
> using gcl (to add support for gcl to Jabberwocky). I found some
> references (see http://savannah.gnu.org/forum/forum.php?forum_id=1610)
> that sockets where supported and I think can use si::socket to connect
> to a server given a port and address but I don't know how I can use
> the result returned by si::socket to create a read/write stream on
> this socket. I Any help is really appreciated.
>
> Thanks
>
>
> Marc
Aloha - you aren't alone in this, a couple of us have been trying this
stuff out.
In a word, 'si::socket' returns a two-way stream that you can read-line
From and print/format to. Below is a snippet that Camm Maquire sent
recently sent in response to a question on the list. It shows the very
basic stuff needed to demonstarte that things are working - I've tried
it on Debian Linux, and someone else did on Windows, and it worked for
each of us.
If it helps any, a lot of the rest of the socket code seems to have been
developed in order to support the Tk portion of Tcl/Tk, which can be
used by GCL for GUI apps.
Good luck!
+Chris
(--------- example -------------)
From: Camm Maguire <address@hidden>
Subject: Re: GCL Socket questions
Newsgroups: gmane.lisp.gcl.devel, gmane.comp.mathematics.axiom.devel
Cc: , address@hidden, root <address@hidden>, address@hidden
Date: 28 Apr 2004 21:58:03 -0400
Greetings!
OK here is a start:
1) Install netcat
2) in a shell, do nc -l -p 1920
3) In gcl osmehwere else, (setq s (si::socket 1920 :host "localhost"))
4) (format s "hello%") ; should appear in netcat window
5) Type "there <cr>" in netcat window
6) In gcl (read-line s) ; (should get "there")
7) In gcl (close s) ; should terminate netcat.
(--------- /example ------------)
--
What is life? It is the flash of a firefly in the night. It is the
breath of a buffalo in the wintertime. It is the little shadow which
runs across the grass and loses itself in the sunset.
--- Crowfoot's last words (1890), Blackfoot warrior and orator.
pgpWvIOvKzcX4.pgp
Description: PGP signature