Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A tox_friend_connection_status event often occurs #868

Closed
hkarel opened this issue Apr 12, 2018 · 5 comments
Closed

A tox_friend_connection_status event often occurs #868

hkarel opened this issue Apr 12, 2018 · 5 comments
Labels
P3 Low priority
Milestone

Comments

@hkarel
Copy link

hkarel commented Apr 12, 2018

I began to notice that when my client (ToxPhone) is running, a tox_friend_connection_status event occurs quite often.

12.04.2018 10:31:55.944846 DEBUG   LWP22452 [tox_net.cpp:1022 ToxNet] ToxEvent: friend TCP connection. Friend name/number: hkarel/7
12.04.2018 10:31:57.790578 DEBUG   LWP22452 [tox_net.cpp:1022 ToxNet] ToxEvent: friend UPD connection. Friend name/number: hkarel/7
12.04.2018 10:32:04.934513 DEBUG   LWP22452 [tox_net.cpp:1022 ToxNet] ToxEvent: friend TCP connection. Friend name/number: hkarel/7
12.04.2018 10:32:06.798105 DEBUG   LWP22452 [tox_net.cpp:1022 ToxNet] ToxEvent: friend UPD connection. Friend name/number: hkarel/7
12.04.2018 10:32:13.915010 DEBUG   LWP22452 [tox_net.cpp:1022 ToxNet] ToxEvent: friend TCP connection. Friend name/number: hkarel/7
...
12.04.2018 12:09:54.783067 DEBUG   LWP22452 [tox_net.cpp:1022 ToxNet] ToxEvent: friend UPD connection. Friend name/number: hkarel/7
12.04.2018 12:10:00.795466 DEBUG   LWP22452 [tox_net.cpp:1022 ToxNet] ToxEvent: friend disonnected. Friend name/number: hkarel/7
12.04.2018 12:10:01.007814 DEBUG   LWP22452 [tox_net.cpp:1022 ToxNet] ToxEvent: friend UPD connection. Friend name/number: hkarel/7
12.04.2018 12:10:01.010377 DEBUG   LWP22452 [tox_net.cpp:931 ToxNet] ToxEvent: friend name changed. Friend name/number: hkarel/7
12.04.2018 12:10:01.010420 DEBUG   LWP22452 [tox_net.cpp:952 ToxNet] ToxEvent: friend status message changed. Friend name/number: hkarel/7
12.04.2018 12:57:02.663650 VERBOSE LWP22452 [tox_net.cpp:996 ToxNet] Disconnected from DHT
12.04.2018 12:57:02.876809 VERBOSE LWP22452 [tox_net.cpp:250 ToxNet] Connecting to bootstrap node 144.217.86.39 : 33445; name: velusip
12.04.2018 12:57:02.878354 VERBOSE LWP22452 [tox_net.cpp:250 ToxNet] Connecting to bootstrap node 2a00:7a60:0:746b::3 : 33445; name: MAH69K
12.04.2018 12:57:04.486442 VERBOSE LWP22452 [tox_net.cpp:250 ToxNet] Connecting to bootstrap node tox.abilinski.com : 33445; name: flobe
12.04.2018 12:57:05.770388 VERBOSE LWP22452 [tox_net.cpp:250 ToxNet] Connecting to bootstrap node tox.deadteam.org : 33445; name: DeadTeam
12.04.2018 12:57:08.480262 VERBOSE LWP22452 [tox_net.cpp:250 ToxNet] Connecting to bootstrap node node.tox.ngc.network : 33445; name: Nolz
12.04.2018 12:57:09.171811 VERBOSE LWP22452 [tox_net.cpp:250 ToxNet] Connecting to bootstrap node 2001:6f8:1c3c:babe::14:1 : 33445; name: Manolis
12.04.2018 12:57:09.670583 VERBOSE LWP22452 [tox_net.cpp:994 ToxNet] Connected to DHT through UDP

Generation of this event lasted an hour and a half with an interval of 10 seconds. And it stopped only after reconnecting to DHT. Full log is attached.
toxphone.log.toxphone.txt

The output of the message "ToxEvent: friend TCP connection" is executed by the following code:

void ToxNet::tox_friend_connection_status(Tox* tox, uint32_t friend_number,
                                          TOX_CONNECTION connection_status, void* user_data)
{
    const char* stat;
    switch (connection_status)
    {
        case TOX_CONNECTION_TCP:
            stat = "TCP connection. ";
            break;

        case TOX_CONNECTION_UDP:
            stat = "UPD connection. ";
            break;

        default:
            stat = "disonnected. ";
    }
    log_debug_m << "ToxEvent: friend " << stat
                << ToxFriendLog(tox, friend_number);
    ...
}

I would like to understand why the event is generated so often and for a long time.
Forgot to add: I use toxcore 0.2.+ Gitrev: eb6b602

@sudden6
Copy link

sudden6 commented Apr 12, 2018

Do you have a reliable connection between the two clients? ie not Wifi?

The function you linked seems to be C++? but toxcore is written in C, so what wrapper are you using? Did you find the line that causes that event in c-toxcore?

@Diadlo
Copy link

Diadlo commented Apr 12, 2018

@sudden6 It's function from @hkarel client. The function used as callback to tox_callback_friend_connection_status

@hkarel
Copy link
Author

hkarel commented Apr 12, 2018

Do you have a reliable connection between the two clients? ie not Wifi?

@sudden6 I use only wire, and both clients are inside my local network. But this behavior is also observed with the EchoBot, which is outside my local network.

@Diadlo wrote correctly - this is callback
tox_callback_friend_connection_status(_tox, tox_friend_connection_status);

@zoff99
Copy link

zoff99 commented Apr 13, 2018

i am seeing these kind of messages also very often. may be worth checking out

@hkarel
Copy link
Author

hkarel commented Apr 24, 2018

Some more information

I've seen this kind of behavior from other clients with large friend lists, like GroupBot. I think this is an issue with toxcore, not with EchoBot.

EchoBot often generates tox_friend_connection_status event

hkarel added a commit to hkarel/c-toxcore that referenced this issue Apr 26, 2018
hkarel added a commit to hkarel/c-toxcore that referenced this issue Apr 26, 2018
hkarel added a commit to hkarel/c-toxcore that referenced this issue Apr 27, 2018
hkarel added a commit to hkarel/c-toxcore that referenced this issue Apr 30, 2018
hkarel added a commit to hkarel/c-toxcore that referenced this issue May 15, 2018
hkarel added a commit to hkarel/c-toxcore that referenced this issue May 21, 2018
hkarel added a commit to hkarel/c-toxcore that referenced this issue May 21, 2018
hkarel added a commit to hkarel/c-toxcore that referenced this issue May 23, 2018
Fixes TokTok#868

Is made by:
1. Fix enumeration mechanism of Crypto_Connection instances in function send_crypto_packets()
   (this item solves the main problem);
2. Disruption of correlation between parameters of different dimensions
   (the parameters MAX_NUM_SENDPACKET_TRIES and UDP_DIRECT_TIMEOUT have different dimensions).
@robinlinden robinlinden modified the milestone: v0.2.11 Mar 20, 2020
@iphydf iphydf added the P3 Low priority label Feb 4, 2022
@iphydf iphydf added this to the v0.2.3 milestone Feb 5, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 Low priority
Projects
None yet
Development

No branches or pull requests

6 participants