]> rtime.felk.cvut.cz Git - can-benchmark.git/blobdiff - ugw/ugw.c
Fix burst benchmark
[can-benchmark.git] / ugw / ugw.c
index 243fc5a3c562f891d7c74b7cc7273b8758796e4e..876d9ce3651d5a4bff0d31892f9c695f37f34080 100644 (file)
--- a/ugw/ugw.c
+++ b/ugw/ugw.c
@@ -104,6 +104,9 @@ void init_read(struct in_ctx *ctx)
 
        s = CHECK(socket(PF_CAN, SOCK_RAW, CAN_RAW));
 
+       int rcvbuf = 25000;     /* Limit rcvbuf to not have so big queueing latencies */
+       CHECK(setsockopt(s, SOL_SOCKET, SO_RCVBUF, &rcvbuf, sizeof(rcvbuf)));
+
        if (nonblocking) {
                int flags = CHECK(fcntl(s, F_GETFL, 0));
                CHECK(fcntl(s, F_SETFL, flags | O_NONBLOCK));