The problem of the fragmented *IDN? response can be mitigated somewhat
by enabling nagle during the response to that command.
| | |
| | | #include <errno.h> |
| | | #include <arpa/inet.h> |
| | | #include <unistd.h> |
| | | #include <netinet/tcp.h> |
| | | |
| | | #include "scpi/scpi.h" |
| | | #include "../common/scpi-def.h" |
| | |
| | | listenfd = createServer(5025); |
| | | |
| | | while (1) { |
| | | int clifd; |
| | | int clifd, flag = 0; |
| | | struct sockaddr_in cliaddr; |
| | | socklen_t clilen; |
| | | |
| | |
| | | |
| | | 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; |