Skip to content

Commit 54db7dc

Browse files
committed
server: clustering comments
1 parent 4c04e9e commit 54db7dc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

server/src/plugin/plugin-remote-worker.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ export function startPluginRemote(mainFilename: string, pluginId: string, peerSe
157157
const clusterPeerAddress = client.remoteAddress;
158158
const clusterPeerPort = client.remotePort;
159159
const clusterPeerKey = getClusterPeerKey(clusterPeerAddress, clusterPeerPort);
160+
// the listening peer sourceKey (client address/port) is used by the OTHER peer (the client)
161+
// to determine if it is already connected to THIS peer (the server).
160162
clusterPeer.onProxySerialization = (value) => onProxySerialization(value, clusterPeerKey);
161163
clusterPeers.set(clusterPeerKey, Promise.resolve(clusterPeer));
162164
startPluginRemoteOptions?.onClusterPeer?.(clusterPeer);
@@ -194,7 +196,8 @@ export function startPluginRemote(mainFilename: string, pluginId: string, peerSe
194196
try {
195197
await once(socket, 'connect');
196198

197-
// the sourceKey is used by peers to determine if they're already connected.
199+
// this connecting peer sourceKey (server address/port) is used by the OTHER peer (the server)
200+
// to determine if it is already connected to THIS peer (the client).
198201
const { address: sourceAddress, port: sourcePort } = (socket.address() as net.AddressInfo);
199202
if (sourceAddress !== SCRYPTED_CLUSTER_ADDRESS && sourceAddress !== '127.0.0.1')
200203
console.warn("source address mismatch", sourceAddress);

0 commit comments

Comments
 (0)