Closed alfiedouglas-tewke closed 1 year ago
I am trying to send a stream of data using observe, following the observe_client.js and observe_server.js examples.
observe
observe_client.js
observe_server.js
However, the client's response only triggers once the server calls the end method on the response, and not after write is called.
end
write
server:
server
const CoapServer = createServer({ reuseAddr: true, }); CoapServer.on('request', (req: IncomingMessage, res: OutgoingMessage) => { // Is this an observe request? If not, just proxy it if (req.headers.Observe !== 1) { ... } else { res.write("test"); } });
client:
client
const req = coap.request({ method: "GET", hostname: "localhost", pathname: "/observe", observe: 1, confirmable: 1, }); req.on('response', (res) => { console.log("req.on('response')"); res.pipe(process.stdout); }); req.end();
Strange, so I am now unable to recreate this bug & perhaps was an issue with my setup. So am going to close the issue.
I am trying to send a stream of data using
observe
, following theobserve_client.js
andobserve_server.js
examples.However, the client's response only triggers once the server calls the
end
method on the response, and not afterwrite
is called.server
:client
: