|
@@ -44,8 +44,10 @@ static UA_StatusCode socket_write(UA_Connection *connection, UA_ByteString *buf,
|
|
|
do {
|
|
|
#ifdef _WIN32
|
|
|
n = send((SOCKET)connection->sockfd, (const char*)buf->data, buflen, 0);
|
|
|
- if(n < 0 && WSAGetLastError() != WSAEINTR && WSAGetLastError() != WSAEWOULDBLOCK)
|
|
|
+ if(n < 0 && WSAGetLastError() != WSAEINTR && WSAGetLastError() != WSAEWOULDBLOCK){
|
|
|
+ connection->close(connection);
|
|
|
return UA_STATUSCODE_BADCONNECTIONCLOSED;
|
|
|
+ }
|
|
|
#else
|
|
|
n = send(connection->sockfd, (const char*)buf->data, buflen, MSG_NOSIGNAL);
|
|
|
if(n == -1L && errno != EINTR && errno != EAGAIN){
|