[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-users] simple sockets
From: |
felix |
Subject: |
[Chicken-users] simple sockets |
Date: |
Mon, 17 Feb 2003 22:23:58 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020529 |
Hello!
I have worked a little on a portable socket library. It implements
the PLT API (tcp-listen, tcp-accept, tcp-connect, etc.) and seems to
work properly on all systems I've tested (Linux, FreeBSD, Win32 VC++/cygwin).
Please take a look at
http://www.call-with-current-continuation.org/tcp.scm
It's pretty easy to use:
;;; server:
(define x (tcp-listen 4242))
(define-values (i o) (tcp-accept x))
; wait...
(write-line "123" o)
(read-line i)
; prints: abc
;;; client:
(define-values (i o) (tcp-connect <hostname> 4242))
(write-line "abc" o)
(read-line i)
; prints: 123
The API should be fully compatible to PLT.
tcp-accept and any I/O on socket ports does not block
other running threads.
cheers,
felix
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Chicken-users] simple sockets,
felix <=