-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Conversation
@@ -86,6 +86,15 @@ bool UnixDomainSocketServer::StartListening() | |||
::bind(m_socket, reinterpret_cast<sockaddr*>(&m_address), sizeof(sockaddr_un)); | |||
fs::permissions(m_path, fs::owner_read | fs::owner_write); | |||
listen(m_socket, 128); | |||
|
|||
int keepalive = 1; | |||
if (setsockopt(m_socket, SOL_SOCKET, SO_KEEPALIVE, &keepalive, sizeof(keepalive) < 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
syntax error
if (setsockopt(m_socket, SOL_SOCKET, SO_KEEPALIVE, &keepalive, sizeof(keepalive) < 0) | |
if (setsockopt(m_socket, SOL_SOCKET, SO_KEEPALIVE, &keepalive, sizeof(keepalive)) < 0) |
@@ -141,7 +150,7 @@ size_t UnixDomainSocketServer::Write(int _connection, string const& _data) | |||
|
|||
size_t UnixDomainSocketServer::Read(int _connection, void* _data, size_t _size) | |||
{ | |||
ssize_t r = read(_connection, _data, _size); | |||
ssize_t r = recv(_connection, _data, _size, MSG_NOSIGNAL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does it do?
Hold on a sec, I have more fixes to this PR. |
I'm newbie in context of socket programming. Is this still a problem? Some time ago I tried to use the unix socket server from libjson-rpc-cpp #4565 but it didn't work at all. There is not a lot of changes there (https://github.com/cinemast/libjson-rpc-cpp/commits/master/src/jsonrpccpp/server/connectors/unixdomainsocketserver.cpp) but we can try again. Maybe they can setup it better than we are doing it currently. |
It is, but this PR isn't finished. Please don't merge. |
I will not have time to ever finish this PR and it is not an issue anymore in Solidity. The problem however persists if anyone wants to fix it. |
Fixes the connection closed issue from ethereum/solidity#3825