Browse Source

Simpler stream connection protocol.

main
Tony Garnock-Jones 1 year ago
parent
commit
824b078eac
  1. 22
      stream.prs
  2. 2
      tcp.prs

22
stream.prs

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

2
tcp.prs

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

Loading…
Cancel
Save