mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-26 01:51:41 +00:00
Turn off Nagle algorithm to decrease latency.
This is safe because of the way writes are performed: for each transmission, all outgoing messages are concatenated in memory and only a single write() syscall is made.
This commit is contained in:
@@ -32,6 +32,9 @@ NetworkConnection::NetworkConnection(std::unique_ptr<NetworkStream> stream,
|
||||
m_proto_rev = 0x0300;
|
||||
m_state = static_cast<int>(kCreated);
|
||||
m_last_update = 0;
|
||||
|
||||
// turn off Nagle algorithm; we bundle packets for transmission
|
||||
m_stream->setNoDelay();
|
||||
}
|
||||
|
||||
NetworkConnection::~NetworkConnection() { Stop(); }
|
||||
|
||||
Reference in New Issue
Block a user