Hi:
How does one alter the directionality of a tcp object port? It defaults to input-port which results in an exception for a write form. -Bob
(define *server-port* 5603)
(define (start-tcp) (define sp (open-tcp-server (list port-number: *server-port* ;;direction: input-output )))
;;(port-settings-set! (list direction: 'input-output))
(if (port? sp) (display "is-a-port\n") (display "not-a-port\n"))
(if (input-port? sp) (display "is-a-input-port\n"))
(if (output-port? sp) (display "is-a-output-port\n")) sp)
Afficher les réponses par date
Hi Bob,
On Jan 29, 2008 12:05 AM, Bob McIsaac bobmc@fcibroadband.com wrote:
Starting a "server port" in Gambit indeed creates a read-only port; however, the objects read from this port are new, bi-directional ports, each representing a pending TCP connection. Communication takes place only on these ports, as it makes no sense to write to a listening socket. Compare this to the BSD sockets interface wherein calling accept() on a listening socket will yield a new socket to begin communications on. Each (read) on the server port is like one accept().
--Jeff
On Jan 29, 2008 12:41 AM, Jeff Read bitwize@gmail.com wrote:
By the way, see also the Gambit documentation section 17.7.3 "Network devices" for more info on this phenomenon.
--Jeff