Repair errors in TCP server facet implementation

This commit is contained in:
Tony Garnock-Jones 2019-06-11 18:48:29 +01:00
parent 0f00b0a83f
commit 7cfa084558
2 changed files with 3 additions and 3 deletions

View File

@ -127,7 +127,7 @@ function spawnWebSocketServer(port) {
const server = Http.HttpServer(null, port);
assert D.AvailableTransport(spec);
during Http.WebSocket($reqId, server, [], _) spawn named [spec, reqId] {
Server.websocketServerFacet(reqId);
Server.websocketServerFacet.call(this, reqId);
}
}
}

View File

@ -32,7 +32,7 @@ export function streamServerFacet(id) {
const decoder = W.makeDecoder(null);
const buf = B.buffer(this, 'chunks');
on message S.Stream(id, S.Data($data)) buf.push(data);
during P.POAReady(reqId) buf.drain((data) => {
during P.POAReady(id) buf.drain((data) => {
decoder.write(data);
let v;
while ((v = decoder.try_next())) send P.FromPOA(id, v);
@ -45,7 +45,7 @@ export function streamServerFacet(id) {
export function streamServerActor(id, debugLabel) {
spawn named [debugLabel || 'stream-poa', id] {
stop on retracted S.Stream(id, S.Duplex());
streamServerFacet(id);
streamServerFacet.call(this, id);
}
}