folkert van heusden
2021-11-19 2a1fbbd629e4c1d7f636bbb7817bea1ba082981a
The problem of the fragmented *IDN? response can be mitigated somewhat
by enabling nagle during the response to that command.
1个文件已修改
5 ■■■■ 已修改文件
examples/test-tcp/main.c 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
examples/test-tcp/main.c
@@ -45,6 +45,7 @@
#include <errno.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <netinet/tcp.h>
#include "scpi/scpi.h"
#include "../common/scpi-def.h"
@@ -193,7 +194,7 @@
    listenfd = createServer(5025);
    while (1) {
        int clifd;
        int clifd, flag = 0;
        struct sockaddr_in cliaddr;
        socklen_t clilen;
@@ -202,6 +203,8 @@
        if (clifd < 0) continue;
    setsockopt(clifd, IPPROTO_TCP, TCP_NODELAY, (char *)&flag, sizeof(int));
        printf("Connection established %s\r\n", inet_ntoa(cliaddr.sin_addr));
        scpi_context.user_context = &clifd;