MemeLabs / MemeLabs/dggchat

Reap/Close old connections when max connection count is hit

Open
#9 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
4
Forks
5
PR merge metrics
No merged PRs in 30d

Description

Due to firefox tabs continually crashing on me, I quickly hit the 5 connection count cap (https://github.com/destinygg/chat/blob/master/connection.go#L138).

Rather than outright rejecting new connections, would it make sense to close old connections (resetting to 0) and allowing new connections?

I'd be perfectly willing to put in a patch/PR should anyone have any input on this.

ian@home ~ $ netstat | awk '/destiny/'
tcp        0      0 192.168.1.4:53654       destiny.gg:https        ESTABLISHED
tcp        0      0 192.168.1.4:54422       destiny.gg:https        ESTABLISHED
tcp        0      0 192.168.1.4:54232       destiny.gg:https        ESTABLISHED
tcp        0      0 192.168.1.4:54588       destiny.gg:https        ESTABLISHED
tcp        0      0 192.168.1.4:53466       destiny.gg:https        ESTABLISHED

I believe @SoMuchForSubtlety is having this issue

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Inspect connection.go around line 138 and trace how the connection count and lifecycle are managed. Reproduce the five-connection case, then define and verify the behavior for closing an old connection and accepting a new one when the cap is reached.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
networking
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.