lesismal / nbio

Pure Go 1000k+ connections solution, support tls/http1.x/websocket and basically compatible with net/http, with high-performance and low memory cost, non-blocking, event-driven, easy-to-use.
MIT License
2.11k stars 151 forks source link

add comments #400

Closed lesismal closed 3 months ago

lesismal commented 3 months ago

Socket

  1. epoll/kqueue: clear fd from poller automatically by syscall.Close will.
  2. Add flow control for write cache flush to avoid large buffer write failure.
  3. Optimize the write cache using buffers to avoid a single large buffer cache.

HTTP:

  1. Change body to [][]byte to avoid single large buffer usage.
  2. Optimize body calculation.
  3. Add MaxHTTPBodySize config.
  4. add Client.Dial configuration.
  5. add Engine.SetETAsyncRead/SetLTSyncRead.

Websocket

  1. Add Lock for parsing logic.
  2. Optimize session consistency.