44 lines
1.3 KiB
Racket
44 lines
1.3 KiB
Racket
#lang racket/base
|
|
|
|
(require racket/set)
|
|
(require racket/match)
|
|
|
|
(require "ssh-numbers.rkt")
|
|
(require "ssh-message-types.rkt")
|
|
(require "ssh-exceptions.rkt")
|
|
|
|
(require "os2-support.rkt")
|
|
|
|
(provide (struct-out ssh-channel))
|
|
|
|
;; A CloseState is one of
|
|
;; - 'neither, indicating that neither side has signalled closure
|
|
;; - 'local, only the local end has signalled closure
|
|
;; - 'remote, only the remote end has signalled closure
|
|
;; - 'both, both ends have signalled closure.
|
|
;; Represents local knowledge of the state of a shared shutdown state
|
|
;; machine.
|
|
;;
|
|
;; 'neither
|
|
;; / \
|
|
;; \/ \/
|
|
;; 'local 'remote
|
|
;; \ /
|
|
;; \/ \/
|
|
;; 'both
|
|
|
|
;; A ChannelState is a (ssh-channel ...) TODO
|
|
;; Named ssh-channel to avoid conflicts with Racket's built-in
|
|
;; synchronous channels.
|
|
(struct ssh-channel (my-ref ;; Uint32
|
|
your-ref ;; Maybe<Uint32>
|
|
type ;; String
|
|
continuations ;; TransactionManager (see ordered-rpc.rkt)
|
|
outbound-window ;; Maybe<Natural>
|
|
outbound-packet-size ;; Maybe<Natural>
|
|
inbound-window ;; Natural
|
|
eof-state ;; CloseState covering EOF signals
|
|
close-state ;; CloseState covering CLOSE signals
|
|
)
|
|
#:transparent)
|