Changeset 15583 in project for chicken


Ignore:
Timestamp:
08/27/09 15:47:45 (10 years ago)
Author:
felix
Message:

tcp ports allow accessing buffer and buffer size; wrapper for setting port data

Location:
chicken/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • chicken/trunk/library.scm

    r15579 r15583  
    145145     ##sys#string->symbol ##sys#symbol->string ##sys#dynamic-unwind ##sys#pathname-resolution
    146146     ##sys#platform-fixup-pathname ##sys#expand-home-path ##sys#string-append ##sys#symbol->qualified-string
    147      ##sys#error-handler ##sys#signal ##sys#abort ##sys#port-data
     147     ##sys#error-handler ##sys#signal ##sys#abort ##sys#port-data ##sys#set-port-data!
    148148     ##sys#reset-handler ##sys#exit-handler ##sys#dynamic-wind ##sys#port-line
    149149     ##sys#grow-vector ##sys#run-pending-finalizers ##sys#peek-char-0 ##sys#read-char-0
     
    18301830
    18311831(define (##sys#port-data port) (##sys#slot port 9))
     1832(define (##sys#set-port-data! port data) (##sys#setslot port 9 data))
    18321833
    18331834(define ##sys#platform-fixup-pathname
  • chicken/trunk/ports.scm

    r13543 r15583  
    227227           (data (vector #f))
    228228           (port (##sys#make-port #t class "(custom)" 'custom)) )
    229       (##sys#setslot port 9 data)
     229      (##sys#set-port-data! port data)
    230230      port) ) )
    231231
     
    251251             (data (vector #f))
    252252             (port (##sys#make-port #f class "(custom)" 'custom)) )
    253         (##sys#setslot port 9 data)
     253        (##sys#set-port-data! port data)
    254254        port) ) ) )
  • chicken/trunk/tcp.scm

    r14101 r15583  
    3939   ##net#socket ##net#bind ##net#connect ##net#listen ##net#accept make-parameter ##sys#string-append ##sys#tcp-port->fileno
    4040   ##sys#check-port ##sys#port-data ##sys#thread-block-for-i/o! make-string make-input-port make-output-port ##sys#substring
    41    substring ##sys#make-c-string ##sys#schedule
     41   substring ##sys#make-c-string ##sys#schedule ##sys#set-port-data!
    4242   ##net#close ##net#recv ##net#send ##net#select ##net#select-write ##net#gethostaddr ##net#io-ports ##sys#update-errno
    4343   ##sys#error ##sys#signal-hook ##net#getservbyname ##net#parse-host ##net#fresh-addr
     
    334334        (##sys#signal-hook #:network-error (##sys#string-append "cannot create TCP ports - " strerror)) )
    335335      (let* ((buf (make-string +input-buffer-size+))
    336              (data (vector fd #f #f))
     336             (data (vector fd #f #f buf 0))
    337337             (buflen 0)
    338338             (bufindex 0)
     
    368368                          (else
    369369                           (set! buflen n)
     370                           (##sys#setislot data 4 n)
    370371                           (set! bufindex 0) ) ) ) ) ) )
    371372             (in
     
    501502        (##sys#setslot in 7 'socket)
    502503        (##sys#setslot out 7 'socket)
    503         (##sys#setslot in 9 data)
    504         (##sys#setslot out 9 data)
     504        (##sys#set-port-data! in data)
     505        (##sys#set-port-data! out data)
    505506        (values in out) ) ) ) )
    506507
Note: See TracChangeset for help on using the changeset viewer.