mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-11 17:00:37 +00:00
LibIPC: Increase the local socket buffer size to 128 KiB if possible
This makes a big difference on macOS, where the default buffer size for local sockets is 8 KiB. With bigger buffers, we don't have to block on IPC nearly as often.
This commit is contained in:
parent
4bc5d6a681
commit
f0fc516cf2
Notes:
github-actions[bot]
2024-09-19 05:38:50 +00:00
Author: https://github.com/awesomekling Commit: https://github.com/LadybirdBrowser/ladybird/commit/f0fc516cf20 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1400
1 changed files with 4 additions and 0 deletions
|
@ -19,6 +19,10 @@ ConnectionBase::ConnectionBase(IPC::Stub& local_stub, NonnullOwnPtr<Core::LocalS
|
|||
, m_socket(move(socket))
|
||||
, m_local_endpoint_magic(local_endpoint_magic)
|
||||
{
|
||||
socklen_t socket_buffer_size = 128 * KiB;
|
||||
(void)Core::System::setsockopt(m_socket->fd().value(), SOL_SOCKET, SO_SNDBUF, &socket_buffer_size, sizeof(socket_buffer_size));
|
||||
(void)Core::System::setsockopt(m_socket->fd().value(), SOL_SOCKET, SO_RCVBUF, &socket_buffer_size, sizeof(socket_buffer_size));
|
||||
|
||||
m_responsiveness_timer = Core::Timer::create_single_shot(3000, [this] { may_have_become_unresponsive(); });
|
||||
m_socket->on_ready_to_read = [this] {
|
||||
NonnullRefPtr protect = *this;
|
||||
|
|
Loading…
Reference in a new issue