File tree 1 file changed +24
-0
lines changed
1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -110,6 +110,30 @@ export async function createServer() {
110
110
}
111
111
} ,
112
112
113
+ // echo server, initiated by local
114
+ async ( ) => {
115
+ for await ( const session of getReaderStream (
116
+ server . sessionStream ( '/bidirectional_server_fin_send' )
117
+ ) ) {
118
+ try {
119
+ // adapted from issue of achingbrain
120
+ const stream = await session . createBidirectionalStream ( )
121
+
122
+ const writer = stream . writable . getWriter ( )
123
+
124
+ await writer . ready
125
+
126
+ writer . write ( Uint8Array . from ( [ 0 , 1 , 2 , 3 ] ) ) . catch ( ( err ) => {
127
+ console . info ( 'error writing to stream' , err )
128
+ } )
129
+
130
+ await writer . close ( )
131
+ } catch {
132
+ // in some tests the client closes the stream
133
+ }
134
+ }
135
+ } ,
136
+
113
137
// echo datagrams, initiated by remote
114
138
async ( ) => {
115
139
for await ( const session of getReaderStream (
You can’t perform that action at this time.
0 commit comments