F-Stack/f-stack

Websocket - Long Latency

harveyliuit opened this issue · 3 comments

I Tried to implement a websocket client. However, the packet got delayed more and more, almost exponentially. Does F-stack have issues with long running TCP connections? Can someone know please help? Thank you in advance.

I guess the question from #811 is related to this issue that you have.
Having in mind the things that I pointed out there, I'd say that:

  • for the receiving side you need to make sure that you are calling epoll and/or read/recv on the corresponding socket in order to get the received data as soon as they arrive
  • for the sending side you can play with the pkt_tx_delay option to see if it'll improve the latency. If you test with single connection with very few packets sent then every packet will be delayed up to pkt_tx_delay microseconds and this will slow down the whole connection. The default value of this option is there for the most common case where you have big number of connections and each one of them is sending packets at full speed i.e. it's there for high throughput scenarios.

Thank you very much @freak82! I'll look into it.

@harveyliuit Have you build websocket client via f-stack? Which websocket opensource project did you base on? or You just wrote it from scratch?
I even can't make a tcp client via f-stack, I got problem as described below.
#624

Can you please help a look? Or Can you share me the client code you run for test?