我创建了一个 TThread 类来执行一些套接字操作,问题是,除非我向其中添加 MessageBox,否则代码不起作用,除非我在它之前放置 MessageBox 调用,否则套接字将不起作用
Sleep(2000); //Waiting for the Socket to Come to the Array
// Messagebox(0, '', '', 0); { Wont work unless this line is Uncommented }
if Server.ClientList[Handle] <> nil then
begin
if (Server.ClientList[Handle].Connected) and (AppSocket.Connected) do
begin
// Send Data on Socket
// Relay Data between Server.ClientList[Handle] and AppSocket;
end;