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

Network cleanup #6310

Merged
merged 4 commits into from Aug 25, 2017
Merged

Network cleanup #6310

merged 4 commits into from Aug 25, 2017

Conversation

nerzhul
Copy link
Member

@nerzhul nerzhul commented Aug 24, 2017

  • Move Connection threads to dedicated files (divide cpp file by 2 & make it more readable)
  • ConnectionReceiveThread::processPacket now uses function pointer table to route MT packet types
  • Remove many packet buffers copy (performance improval)
  • Various code style fixes

* ConnectionReceiveThread::processPacket now uses function pointer table to route MT packet types
* Various code style fixes
@nerzhul nerzhul added @ Build CMake, build scripts, official builds, compiler and linker errors @ Network labels Aug 24, 2017
* SharedBuffer cannot be copied anymore using Buffer
* Fix many SharedBuffer copy (thanks to delete operator)
std::list<BufferedPacket> timed_outs;

if (dynamic_cast<UDPPeer *>(&peer)->getLegacyPeer())
channel.setWindowSize(g_settings->getU16("workaround_window_size"));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Undocumented setting.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, i moved the code but didn't see that, what is that thing, i think i will remove it, it's too dangerous for a end user

continue;
}

float resend_timeout = dynamic_cast<UDPPeer *>(&peer)->getResendTimeout();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UDPPeer *udp_peer = dynamic_cast<UDPPeer *>(&peer);, shortens and improves readability on 9 lines.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exact :)

while ((!channel.queued_reliables.empty()) &&
(channel.outgoing_reliables_sent.size()
< channel.getWindowSize()) &&
(peer->m_increment_packets_remaining > 0)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indents missing and redundant parentheses.

@nerzhul nerzhul merged commit 3cea7a3 into minetest:master Aug 25, 2017
@nerzhul nerzhul deleted the network_cleanups branch August 25, 2017 14:11
osjc pushed a commit to osjc/minetest that referenced this pull request Jan 11, 2019
* Move Connection threads to dedicated files + various cleanups

* ConnectionReceiveThread::processPacket now uses function pointer table to route MT packet types
* Various code style fixes

* Code style with clang-format

* Various SharedBuffer copy removal

* SharedBuffer cannot be copied anymore using Buffer
* Fix many SharedBuffer copy (thanks to delete operator)
osjc pushed a commit to osjc/minetest that referenced this pull request Jan 23, 2019
* Move Connection threads to dedicated files + various cleanups

* ConnectionReceiveThread::processPacket now uses function pointer table to route MT packet types
* Various code style fixes

* Code style with clang-format

* Various SharedBuffer copy removal

* SharedBuffer cannot be copied anymore using Buffer
* Fix many SharedBuffer copy (thanks to delete operator)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@ Build CMake, build scripts, official builds, compiler and linker errors @ Network One approval ✅ ◻️ Performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants