procedure TServerClientThread.ClientExecute; var FDSet: TFDSet; TimeVal: TTimeVal; begin while not Terminated and ClientSocket.Connected do begin FD_ZERO(FDSet); FD_SET(ClientSocket.SocketHandle, FDSet); TimeVal.tv_sec := 0; TimeVal.tv_usec := 500; if (select(0, @FDSet, nil, nil, @TimeVal) > 0) and not Terminated then if ClientSocket.ReceiveBuf(FDSet, -1) = 0 then Break else Synchronize(DoRead);