TCPserver without OnExecute event

后端 未结 5 1022
情歌与酒
情歌与酒 2021-01-06 04:20

I want to make a TCPserver and send/receive message to clients as needed, not OnExecute event of the TCPserver.

Send/receive message is not a probl

5条回答
  •  别那么骄傲
    2021-01-06 04:35

    The Indy component set is designed to emulate blocking operation on a network connection. You're supposed to encapsulate all your code in the OnExecute event handler. That's supposed to be easier, because most protocols are blocking any way (send command, wait for response, etc).

    You apparently don't like it's mode of operation, you'd like something that works without blocking. You should consider using a component suite that's designed for the way you intend to use it: give the ICS suite a try! ICS doesn't use threads, all the work is done in event handlers.

提交回复
热议问题