在一个处理线程中如下写一个网络收发包的线程程序,是否会使该线程阻塞?
while(true) do
begin
ZeroMemory(@data[0],1500);
pdata:=@data[0];
szfrom:=sizeof(TSockAddr);
recvCount := recvfrom(ServiceSocket, pdata^,1500,0,from,szfrom); //接收错误
if (recvCount = -1) then
begin
continue;
end;
……
end;
其中if (recvCount = -1) then contiue;是否会使程序进入死循环?从而导致线程阻塞?
while(true) do
begin
ZeroMemory(@data[0],1500);
pdata:=@data[0];
szfrom:=sizeof(TSockAddr);
recvCount := recvfrom(ServiceSocket, pdata^,1500,0,from,szfrom); //接收错误
if (recvCount = -1) then
begin
continue;
end;
……
end;
其中if (recvCount = -1) then contiue;是否会使程序进入死循环?从而导致线程阻塞?
其中if (recvCount = -1) then contiue;是否会使程序进入死循环?从而导致线程阻塞?
问题是if (recvCount = -1) then contiue这一句会不会在某种情况下死循环?