frontend: bad improvements
This commit is contained in:
@@ -176,6 +176,25 @@ class GameStreamingApp {
|
||||
await transport.ready;
|
||||
console.log('WebTransport connection established');
|
||||
|
||||
|
||||
console.log('Creating WebTransport bidirectional stream');
|
||||
const stream = await transport.createBidirectionalStream();
|
||||
console.log('Bidirectional stream created');
|
||||
|
||||
const reader = stream.readable.getReader();
|
||||
|
||||
// Handle incoming data
|
||||
async function readData() {
|
||||
while (true) {
|
||||
const { value, done } = await reader.read();
|
||||
if (done) break;
|
||||
console.log(value)
|
||||
//console.log(`Received: ${new TextDecoder().decode(value)}`);
|
||||
}
|
||||
}
|
||||
|
||||
readData();
|
||||
|
||||
// Handle connection close
|
||||
transport.closed.then(() => {
|
||||
console.log('WebTransport connection closed');
|
||||
|
||||
Reference in New Issue
Block a user