Skip to content

Commit

Permalink
tweak large custom NGC packet cross test
Browse files Browse the repository at this point in the history
  • Loading branch information
zoff99 committed Jan 9, 2024
1 parent 3ad393f commit 9f3a56c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ int main(int argc, char *argv[])
printf("RCV:received %d custom packets already\n", self_revd_custom_pkts);

long count = 0;
long max_count = 2000;
long max_count = 30000;
while (count < max_count) {
tox_iterate(tox, NULL);
usleep(tox_iteration_interval(tox));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,8 @@ int main(void)

Tox_Err_Group_Send_Custom_Packet error1;
Tox_Err_Group_Send_Custom_Private_Packet error2;
const int data_grp_pkt_len = 30000;
const int data_grp_pvt_pkt_len = 30000;
const int data_grp_pkt_len = 60000;
const int data_grp_pvt_pkt_len = 60000;
uint8_t *data_grp_pkt = (uint8_t *)calloc(1, data_grp_pkt_len);
uint8_t *data_grp_pvt_pkt = (uint8_t *)calloc(1, data_grp_pvt_pkt_len);

Expand All @@ -262,8 +262,21 @@ int main(void)
usleep(tox_iteration_interval(tox));
}

for (int k=38000;k<40001;k=k+1000)
{
tox_group_send_custom_packet(tox, 0, true, data_grp_pkt, k, &error1);
tox_iterate(tox, NULL);
usleep(tox_iteration_interval(tox));
}

for (int k=39998;k<40021;k++)
{
tox_group_send_custom_packet(tox, 0, true, data_grp_pkt, k, &error1);
tox_iterate(tox, NULL);
usleep(tox_iteration_interval(tox));
}

tox_group_send_custom_packet(tox, 0, true, data_grp_pkt, data_grp_pkt_len, &error1);
tox_group_send_custom_private_packet(tox, 0, 1, true, data_grp_pvt_pkt, data_grp_pvt_pkt_len, &error2);
tox_iterate(tox, NULL);
usleep(tox_iteration_interval(tox));

Expand Down

0 comments on commit 9f3a56c

Please sign in to comment.