Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ユーザーが Web ページにアクセスすると、node.js は io.sockets.on("connection", ..) イベントを 3 回起動します。SQL クエリを実行するため、これは避けたいと思います。訪問者ごとに 3 回実行したくありません。
そのうちの 1 つはクライアント側の JS のようです。クライアント JS の socket.io 接続行を除いてすべてコメントアウトしましたが、node.js で 2 つの接続イベントが発生していることがわかります。
原因は何ですか?