Most efficient way to handle a client connection (socket programming)

后端 未结 7 680
走了就别回头了
走了就别回头了 2021-01-18 11:26

For every single tutorials and examples I have seen on the internet for Linux/Unix socket tutorials, the server side code always involves an infinite loop that checks for cl

7条回答
  •  礼貌的吻别
    2021-01-18 12:02

    For C++ you could look into boost.asio. You could also look into e.g. asynchronous I/O functions. There is also SIGIO.

    Of course, even when using these asynchronous methods, your main program still needs to sit in a loop, or the program will exit.

提交回复
热议问题