Skip to content

Commit 0f130ea

Browse files
committed
SocketImpl MSG_NOSIGNAL
1 parent fe14775 commit 0f130ea

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ArduinoCore-Linux/cores/arduino/SocketImpl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ int SocketImpl::connect(const char *address, uint16_t port) {
103103
// -1=>Error
104104
size_t SocketImpl::write(const uint8_t *str, size_t len) {
105105
Logger.debug(SOCKET_IMPL, "write");
106-
return ::send(sock, str, len, 0);
106+
return ::send(sock, str, len, MSG_NOSIGNAL);
107107
}
108108

109109
// provides the available bytes
@@ -118,7 +118,7 @@ size_t SocketImpl::available() {
118118

119119
// direct read
120120
size_t SocketImpl::read(uint8_t *buffer, size_t len) {
121-
size_t result = ::recv(sock, buffer, len, MSG_DONTWAIT);
121+
size_t result = ::recv(sock, buffer, len, MSG_DONTWAIT | MSG_NOSIGNAL);
122122
char lenStr[80];
123123
sprintf(lenStr, "%ld -> %ld", len, result);
124124
Logger.debug(SOCKET_IMPL, "read->", lenStr);

0 commit comments

Comments
 (0)