Copyright © https://mongoose-os.com

Mongoose OS Forum

frame

LWIP - setting TCP_NODELAY

I'm sending realtime data over a Mongoose websocket and I can see with wireshark that packets are being combined, which is undesirable.

I'm using ESP32. I can see in LWIP that TCP_NODELAY needs to be set as a socket option - I can't see how to this from Mongoose.

I'll probably figure it out but if someone knows my deadline will be very grateful ;-)

Comments

  • timtim Dublin
    edited February 18

    looks like it can be set on the client (sorry that I didn't explain that Mongoose is running a server)

    however this doesn't seem to solve the problem - I guess this is because a websocket is actually 2 sockets, one either end

  • timtim Dublin

    this seems to work (in the mongoose event handler with struct mg_connection *nc):

    int val=1
    setsockopt(nc->sock, IPPROTO_TCP, TCP_NODELAY, &val, (socklen_t)sizeof(val));
    
Sign In or Register to comment.