chicken-users
[Top][All Lists]
Advanced

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

[Chicken-users] Re: stream API (was busy-wait in tcp-connect)


From: Kon Lovett
Subject: [Chicken-users] Re: stream API (was busy-wait in tcp-connect)
Date: Wed, 23 May 2007 08:08:12 -0700


On May 23, 2007, at 4:15 AM, Dan Muresan wrote:

LOCATION    calling procedure/context id
NAME        name for the port (usually the process command pathname)
FILENO        open file descriptor
BUFFER-INFO    either a fixnum size or a string
ON-CLOSE    fileno was closed notification procedure
MORE-PREDICATE boolean procedure indicating whether more input is available, usually not needed but the programmer may know something that the C 'read' procedure doesn't

Interesting... Let me put forward the following proposal:

1. Binary streams, maybe wrapping fread / fwrite.

2. Two stream APIs (one for binary and one for char ports)

The ideea would be that I'd be able to write, for example, my own application-level reliable transport protocol over UDP, and wrap it into Chicken Streams. The char output stream API could look like

(##sys#make-output-stream write-char close)

and the input one

(##sys#make-input stream peek-char read-char close)

See make-output/input-port, in the extras unit.


This, of course, doesn't yet take into account threads and UTF8.

What do you guys think?





reply via email to

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