IDTcpServer怎么向指定的客户端发送数?
IDTcpServer怎么向指定的客户端发送数?
请各位高手指教最好有详细的代码,我用C++ buiklder 6.0
[解决办法]
TList *lst = IdTCPServer1->Threads->LockList();try{ for (int i = 0; i < lst->Count; i++) { TIdPeerThread *pt = (TIdPeerThread *)lst->Items[i]; // 可根据条件过滤 // if (pt->Connection->Binding->PeerIP == "" // && pt->Connection->Binding->PeerPort == 123) pt->Connection->Write("要发送的内容"); }}__finally{ IdTCPServer1->Threads->UnlockList();}