question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Double connection

See original GitHub issue

Hi there, I got a double connection when using this code. Is there a way to prevent this?

import { Injectable } from '@angular/core';
import { Socket } from 'ngx-socket-io';
import { AuthService } from '../auth/auth.service';
import { WSMessage } from '../dto/i-ws-message';

@Injectable({
  providedIn: 'root',
})
export class WebsocketService {
  constructor(private socket: Socket, private _auth: AuthService) {}

  receiveUpdates(channel: string) {
    return this.socket.fromEvent(channel);
  }
}

NestJS backend log:

[Nest] 59975   - 2020-11-07 12:24:00   [AppGateway] Client disconnected: _BLVWByuUyrDezIQAAAC
[Nest] 59975   - 2020-11-07 12:24:00   [AppGateway] Client disconnected: _BLVWByuUyrDezIQAAAC
[Nest] 59975   - 2020-11-07 12:24:01   [AppGateway] Client connected: NaKNu7dpQlh7kuDcAAAD
[Nest] 59975   - 2020-11-07 12:24:01   [AppGateway] Client connected: NaKNu7dpQlh7kuDcAAAD
[Nest] 59975   - 2020-11-07 12:27:06   [AppGateway] Client disconnected: NaKNu7dpQlh7kuDcAAAD
[Nest] 59975   - 2020-11-07 12:27:06   [AppGateway] Client disconnected: NaKNu7dpQlh7kuDcAAAD
[Nest] 59975   - 2020-11-07 12:27:07   [AppGateway] Client connected: aC1HCY4emBuYp0X8AAAE
[Nest] 59975   - 2020-11-07 12:27:07   [AppGateway] Client connected: aC1HCY4emBuYp0X8AAAE

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:12

github_iconTop GitHub Comments

2reactions
grafixencommented, Apr 3, 2021

@grafixen It looks like that sample is using a Socket.IO version 2.1? Version 4.0 requires the use of Socket.IO 4.0

You are right. Downgrading ngx-socket-io to v3.2.0 seems to solve the issue. Thank you!

0reactions
MincDevcommented, Jun 2, 2022

I am still getting the double connection issue. I’ve tried installing the versions suggested, but this does not help.

Read more comments on GitHub >

github_iconTop Results From Across the Web

"How To Tie A Double Connection Knot" - WhyKnot - YouTube
Knot tying video tutorial. Learn how to tie a double connection knot. Step by step instructions in this simple DIY guide.
Read more >
Definition: Double connection from 29 CFR § 1926.751
Double connection. Double connection means an attachment method where the connection point is intended for two pieces of steel which share common bolts...
Read more >
1926 Subpart R App H - Double Connections: Illustration of a ...
Title: Double Connections: Illustration of a Clipped End Connection and a Staggered Connection: Non-Mandatory Guidelines for Complying With § 1926.756(c)(1) ...
Read more >
Double Connection Knot - Free Macrame Patterns
Description: The Double Connection Knot is used in combination with other Chinese Macrame knots. It's actually a linked Overhand knot made with one...
Read more >
Double Connection Dog Leashes: Euro vs. standard Training ...
Need a Double Connection dog leash for your Freedom Harness? We can help you decide if you want the longer, shorter, or both...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found