Revert "*Use setup event to ensure the RPC channels are setup for the stream only after state sync from the master protomux"
This reverts commit 88a191ae13
.
This commit is contained in:
parent
88a191ae13
commit
7b65990741
11
src/index.ts
11
src/index.ts
|
@ -1,13 +1,8 @@
|
||||||
import { addHandler, handleMessage } from "libkmodule";
|
import { addHandler, handleMessage } from "libkmodule";
|
||||||
import type { ActiveQuery } from "libkmodule";
|
import type { ActiveQuery } from "libkmodule";
|
||||||
import {
|
import { createClient, SwarmClient } from "@lumeweb/kernel-swarm-client";
|
||||||
createClient,
|
|
||||||
Socket,
|
|
||||||
SwarmClient,
|
|
||||||
} from "@lumeweb/kernel-swarm-client";
|
|
||||||
import { RpcNetwork, RpcQueryOptions } from "@lumeweb/rpc-client";
|
import { RpcNetwork, RpcQueryOptions } from "@lumeweb/rpc-client";
|
||||||
import type { RPCRequest, RPCResponse } from "@lumeweb/interface-relay";
|
import type { RPCRequest, RPCResponse } from "@lumeweb/interface-relay";
|
||||||
import { setupStream } from "@lumeweb/rpc-client";
|
|
||||||
|
|
||||||
onmessage = handleMessage;
|
onmessage = handleMessage;
|
||||||
|
|
||||||
|
@ -103,10 +98,6 @@ async function createNetwork(def = true): Promise<number> {
|
||||||
const id = nextId();
|
const id = nextId();
|
||||||
networkInstances.set(id, dhtInstance);
|
networkInstances.set(id, dhtInstance);
|
||||||
|
|
||||||
dhtInstance.swarm.on("setup", (socket: Socket) => {
|
|
||||||
setupStream(socket);
|
|
||||||
});
|
|
||||||
|
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue