@@ -55,9 +55,6 @@ const serverSessionRead = Promise.withResolvers();
5555const readChunks = [ ] ;
5656let serverSessionStream ;
5757const serverEndpoint = await listen ( mustCall ( async ( ss ) => {
58- ss . onstream = mustNotCall ( async ( stream ) => {
59- console . log ( 'Does nothing but is required! Fix me!' ) ;
60- } ) ;
6158 ss . onapplication = mustCall ( ( aopts ) => {
6259 assert . strictEqual ( ! aopts . enableDatagrams , false ) ;
6360 } ) ;
@@ -100,7 +97,11 @@ const serverEndpoint = await listen(mustCall(async (ss) => {
10097 enableDatagrams : true ,
10198 enableWebtransport : true
10299 } ,
103- transportParams : { maxDatagramFrameSize : 100 } ,
100+ transportParams : {
101+ maxDatagramFrameSize : 100 ,
102+ initialMaxStreamsBidi : 100 , // default value according to spec
103+ initialMaxStreamsUni : 100 , // especially important as limit default is 0
104+ } ,
104105 onheaders : mustCall ( function ( headers ) {
105106 try {
106107 assert . strictEqual ( headers [ ':scheme' ] , 'https' ) ;
@@ -128,7 +129,11 @@ const clientSession = await connect(serverEndpoint.address, {
128129 enableDatagrams : true ,
129130 enableWebtransport : true
130131 } ,
131- transportParams : { maxDatagramFrameSize : 1000 } ,
132+ transportParams : {
133+ maxDatagramFrameSize : 1000 ,
134+ initialMaxStreamsBidi : 100 , // default value according to spec
135+ initialMaxStreamsUni : 100 , // especially important as limit default is 0
136+ } ,
132137} ) ;
133138
134139const webtransportSupport = Promise . withResolvers ( ) ;
@@ -156,7 +161,7 @@ clientSession.onstream = mustNotCall((stream) => {
156161await clientSession . opened ;
157162await webtransportSupport . promise ;
158163// Now we open a webtransport session, which is actually
159- // a special unidirectional stream
164+ // a special bidirectional stream
160165const wtSessionStream = await clientSession . createBidirectionalStream ( {
161166 body : '' ,
162167} ) ;
@@ -176,7 +181,7 @@ wtSessionStream.sendHeaders({
176181} ) ;
177182
178183// Well let's get a unidi stream and send something
179- const clientUnidiStream = await clientSession . createBidirectionalStream ( {
184+ const clientUnidiStream = await clientSession . createUnidirectionalStream ( {
180185 incremental : true ,
181186 webtransportSession : wtSessionStream // Associate it with the sessionStream
182187} ) ;
@@ -187,7 +192,6 @@ clientUnidiStream.closed.catch((error) => {
187192// Next step send some data
188193await serverSessionOpened . promise ;
189194
190-
191195const w = clientUnidiStream . writer ;
192196for ( let i = 0 ; i < numChunks ; i ++ ) {
193197 const chunk = buildChunk ( i ) ;
0 commit comments