assert(ret_len == sizeof(connect));
do {
- ret_len = recv(ctx->control_sock, &connect, sizeof(connect), 0);
+ ret_len = recv(ctx->control_sock, &connect, sizeof(connect), MSG_WAITALL);
} while (ret_len < 0 && errno == EINTR);
if (ret_len == 0) {
fprintf(stderr, "[error] Remote side has closed connection\n");
assert(ret_len == sizeof(cmd));
do {
- ret_len = recv(ctx->control_sock, &list, sizeof(list), 0);
+ ret_len = recv(ctx->control_sock, &list, sizeof(list), MSG_WAITALL);
} while (ret_len < 0 && errno == EINTR);
if (ret_len == 0) {
fprintf(stderr, "[error] Remote side has closed connection\n");
sessions_count = be32toh(list.sessions_count);
for (i = 0; i < sessions_count; i++) {
do {
- ret_len = recv(ctx->control_sock, &lsession, sizeof(lsession), 0);
+ ret_len = recv(ctx->control_sock, &lsession, sizeof(lsession), MSG_WAITALL);
} while (ret_len < 0 && errno == EINTR);
if (ret_len == 0) {
fprintf(stderr, "[error] Remote side has closed connection\n");
memset(&rq, 0, sizeof(rq));
rq.session_id = htobe64(id);
// TODO: add cmd line parameter to select seek beginning
- // rq.seek = htobe32(LTTNG_VIEWER_SEEK_BEGINNING);
- rq.seek = htobe32(LTTNG_VIEWER_SEEK_LAST);
+ rq.seek = htobe32(LTTNG_VIEWER_SEEK_BEGINNING);
+ //rq.seek = htobe32(LTTNG_VIEWER_SEEK_LAST);
do {
ret_len = send(ctx->control_sock, &cmd, sizeof(cmd), 0);
assert(ret_len == sizeof(rq));
do {
- ret_len = recv(ctx->control_sock, &rp, sizeof(rp), 0);
+ ret_len = recv(ctx->control_sock, &rp, sizeof(rp), MSG_WAITALL);
} while (ret_len < 0 && errno == EINTR);
if (ret_len == 0) {
fprintf(stderr, "[error] Remote side has closed connection\n");
ctx->session->stream_count);
for (i = 0; i < be32toh(rp.streams_count); i++) {
do {
- ret_len = recv(ctx->control_sock, &stream, sizeof(stream), 0);
+ ret_len = recv(ctx->control_sock, &stream, sizeof(stream), MSG_WAITALL);
} while (ret_len < 0 && errno == EINTR);
if (ret_len == 0) {
fprintf(stderr, "[error] Remote side has closed connection\n");
assert(ret_len == sizeof(rq));
do {
- ret_len = recv(ctx->control_sock, &rp, sizeof(rp), 0);
+ ret_len = recv(ctx->control_sock, &rp, sizeof(rp), MSG_WAITALL);
} while (ret_len < 0 && errno == EINTR);
if (ret_len == 0) {
fprintf(stderr, "[error] Remote side has closed connection\n");
assert(ret_len == sizeof(rq));
do {
- ret_len = recv(ctx->control_sock, &rp, sizeof(rp), 0);
+ ret_len = recv(ctx->control_sock, &rp, sizeof(rp), MSG_WAITALL);
} while (ret_len < 0 && errno == EINTR);
if (ret_len == 0) {
fprintf(stderr, "[error] Remote side has closed connection\n");
assert(ret_len == sizeof(rq));
do {
- ret_len = recv(ctx->control_sock, &rp, sizeof(rp), 0);
+ ret_len = recv(ctx->control_sock, &rp, sizeof(rp), MSG_WAITALL);
} while (ret_len < 0 && errno == EINTR);
if (ret_len == 0) {
fprintf(stderr, "[error] Remote side has closed connection\n");
assert(ret_len == sizeof(cmd));
do {
- ret_len = recv(ctx->control_sock, &resp, sizeof(resp), 0);
+ ret_len = recv(ctx->control_sock, &resp, sizeof(resp), MSG_WAITALL);
} while (ret_len < 0 && errno == EINTR);
if (ret_len == 0) {
fprintf(stderr, "[error] Remote side has closed connection\n");
assert(ret_len == sizeof(rq));
do {
- ret_len = recv(ctx->control_sock, &rp, sizeof(rp), 0);
+ ret_len = recv(ctx->control_sock, &rp, sizeof(rp), MSG_WAITALL);
} while (ret_len < 0 && errno == EINTR);
if (ret_len == 0) {
fprintf(stderr, "[error] Remote side has closed connection\n");
ctx->session->stream_count);
for (i = 0; i < stream_count; i++) {
do {
- ret_len = recv(ctx->control_sock, &stream, sizeof(stream), 0);
+ ret_len = recv(ctx->control_sock, &stream, sizeof(stream), MSG_WAITALL);
} while (ret_len < 0 && errno == EINTR);
if (ret_len == 0) {
fprintf(stderr, "[error] Remote side has closed connection\n");