close() is not closing socket properly

后端 未结 3 717
既然无缘
既然无缘 2020-11-28 03:06

I have a multi-threaded server (thread pool) that is handling a large number of requests (up to 500/sec for one node), using 20 threads. There\'s a listener thread that acc

3条回答
  •  春和景丽
    2020-11-28 03:45

    This sounds to me like a bug in your Linux distribution.

    The GNU C library documentation says:

    When you have finished using a socket, you can simply close its file descriptor with close

    Nothing about clearing any error flags or waiting for the data to be flushed or any such thing.

    Your code is fine; your O/S has a bug.

提交回复
热议问题