MirrorNetworking / MirrorNetworking/Telepathy

client callback OnDisconnected always being called twice

Open
#126 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
1.2k
Forks
141
PR merge metrics
No merged PRs in 30d

Description

The intention of pull #121 from @imerr was to have the callback client.OnDisconnected being called within the client even in case of socket errors or different exceptions.

I think that intention was fulfilled. This can be verified for example by calling client.Connect("localhost", 13378888); which uses an invalid port.

On the other hand I think that the change had unintended side effects. In my project I can see that within the client during regular, error-free use the callback client.OnDisconnected is always called twice. It does not matter whether the client or the server initiated the disconnect.

In my opinion that callback should only be called once (not twice).

My knowledge about Telepathy is not good enough to suggest an improvement or even create a pull request, sorry.

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

Start at the client.Connect("localhost", 13378888) entry point and trace the paths that invoke client.OnDisconnected during normal client- and server-initiated disconnects, as well as socket errors. Reproduce the regular disconnect and invalid-port cases, then verify that each disconnect results in one callback rather than two.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.