Skip to content

Commit 6da2256

Browse files
knizhnikkelvich
authored andcommitted
Extend error message
1 parent 3c46945 commit 6da2256

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

contrib/multimaster/sockhub/sockhub.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ int ShubReadSocketEx(int sd, void* buf, int min_size, int max_size)
7878
while (received < min_size) {
7979
int n = recv(sd, (char*)buf + received, max_size - received, 0);
8080
if (n <= 0) {
81+
fprintf(stderr, "recv failed on socket %d with error code %d, errno=%d\n", sd, n, errno);
8182
break;
8283
}
8384
received += n;
@@ -96,6 +97,7 @@ int ShubWriteSocket(int sd, void const* buf, int size)
9697
while (size != 0) {
9798
int n = send(sd, src, size, 0);
9899
if (n <= 0) {
100+
fprintf(stderr, "send failed on socket %d with error code %d, errno=%d\n", sd, n, errno);
99101
return 0;
100102
}
101103
size -= n;

0 commit comments

Comments
 (0)