[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: uniform-array-read!
From: |
William Xu |
Subject: |
Re: uniform-array-read! |
Date: |
Fri, 03 Feb 2006 12:35:40 +0800 |
User-agent: |
Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) |
Alan Bram <address@hidden> writes:
[...]
> |
> | (define read-network-byte
> | (lambda (port)
> | (let ((v (make-uniform-array #\nul 1)))
^^^
when array size is 1, it works. But if i set it to 3, for instance. Then
it'll still block..
> | (uniform-array-read! v port)
> | (uniform-vector-ref v 0))))
> `--
And i made the following workaround, using `recv!'. At least it works as
expected.
(define (qq-read-binary-list sock length)
"Read at most LENGTH bytes from SOCK. Return a list of integers."
(let* ((buf (make-string length #\ ))
(count (recv! sock buf)))
(if (> count 0) ; we have read something.
(map
char->integer
(string->list (substring buf 0 count)))
lst)))
--
William
- Re: uniform-array-read!, Ludovic Courtès, 2006/02/01
- Re: uniform-array-read!, Kevin Ryde, 2006/02/02
- Re: uniform-array-read!, Alan Bram, 2006/02/02
- Re: uniform-array-read!,
William Xu <=
- Re: uniform-array-read!, William Xu, 2006/02/02
- Re: uniform-array-read!, Alan Bram, 2006/02/03
- Re: uniform-array-read!, William Xu, 2006/02/03
- Re: uniform-array-read!, Marius Vollmer, 2006/02/04
- Re: uniform-array-read!, Alan Bram, 2006/02/04
Re: uniform-array-read!, Marius Vollmer, 2006/02/11