You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 14, 2024. It is now read-only.
This example demonstrates multi-threading via the `cluster` module utilizing a `net` server for initial socket receipt. An alternate example demonstrating use of the `connectionRouter``serverOptions` hook is available in the `examples` directory.
557
+
558
+
```
559
+
const cluster = require('cluster');
560
+
const ldap = require('ldapjs');
561
+
const net = require('net');
562
+
const os = require('os');
563
+
564
+
const threads = [];
565
+
threads.getNext = function () {
566
+
return (Math.floor(Math.random() * this.length));
567
+
};
568
+
569
+
const serverOptions = {
570
+
port: 1389
571
+
};
572
+
573
+
if (cluster.isMaster) {
574
+
const server = net.createServer(serverOptions, (socket) => {
0 commit comments