Simpler stream connection protocol.

This commit is contained in:
Tony Garnock-Jones 2021-06-18 13:48:12 +02:00
parent cf93327ed6
commit 824b078eac
2 changed files with 7 additions and 17 deletions

View File

@ -1,24 +1,14 @@
version 1 . version 1 .
embeddedType EntityRef.Ref . embeddedType EntityRef.Ref .
; Assertions ; Assertion:
StreamConnection = <stream-connection @source #!Source @sink #!Sink @spec any>. StreamConnection = <stream-connection @source #!Source @sink #!Sink @spec any>.
StreamSpecListenable = <stream-spec-listenable @spec any>.
StreamSpecConnectable = <stream-spec-connectable @spec any>.
; Assertion ; Assertions:
StreamListener = <stream-listener @spec any @handle #!ConnectionHandler>. StreamListenerReady = <stream-listener-ready @spec any>.
StreamListenerError = <stream-listener-error @spec any @message string>.
; Assertion ; Assertion:
StreamConnect = <stream-connect @spec any @handle #!ConnectionHandler>.
; Assertion
ConnectionHandler =
/ @connected <stream-connected @source #!Source @sink #!Sink>
/ @rejected <stream-rejected @message string>
.
; Assertion
StreamError = <error @message string>. StreamError = <error @message string>.
Source = Source =
@ -40,7 +30,9 @@ Sink =
/ <eof> / <eof>
. .
; Value:
CreditAmount = @count int / @unbounded =unbounded . CreditAmount = @count int / @unbounded =unbounded .
; Value:
Mode = =bytes / @lines LineMode / <packet @size int> / <object @description any>. Mode = =bytes / @lines LineMode / <packet @size int> / <object @description any>.
LineMode = =lf / =crlf . LineMode = =lf / =crlf .

View File

@ -5,5 +5,3 @@ TcpRemote = <tcp-remote @host string @port int>.
TcpLocal = <tcp-local @host string @port int>. TcpLocal = <tcp-local @host string @port int>.
TcpPeerInfo = <tcp-peer @handle #!any @local TcpLocal @remote TcpRemote>. TcpPeerInfo = <tcp-peer @handle #!any @local TcpLocal @remote TcpRemote>.
TcpListenError = <tcp-listen-error @spec TcpLocal @message string>.