What's the idiomatic way to do async socket programming in Delphi?

后端 未结 10 940
迷失自我
迷失自我 2021-01-04 19:18

What is the normal way people writing network code in Delphi use Windows-style overlapped asynchronous socket I/O?

Here\'s my prior research into this question:

10条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-04 20:03

    @Roddy - Synchronous sockets are not what I'm after. Burning a whole thread for the sake of a possibly long-lived connection means you limit the amount of concurrent connections to the number of threads that your process can contain. Since threads use a lot of resources - reserved stack address space, committed stack memory, and kernel transitions for context switches - they do not scale when you need to support hundreds of connections, much less thousands or more.

提交回复
热议问题