远
远帆
Unregistered / Unconfirmed
GUEST, unregistred user!
为什么下面这段代码将注释掉的一句一加入就运行不正常?
repeat
FillMemory(@BufRecv, 1025, 0);
Re := recvfrom(Skt1, BufRecv, 1024, 0, Addr, AddLen);
LoopStop := (Re = SOCKET_ERROR);
ShowMessage('1:' + IntToStr(Re));
if not (LoopStop) then
begin
Memo1.Lines.Add('data receive from: ' + inet_ntoa(Addr.sin_addr));
for n := 0 to Re - 1 do
begin
if BufRecv[n] = 0 then
Memo1.Lines.Text := Memo1.Lines.Text + (char(94)) //char(^)
else
Memo1.Lines.Text := Memo1.Lines.Text + (char(BufRecv[n]));
end;
Memo1.Lines.Text := Memo1.Lines.Text + #13;
Memo1.Lines.Text := Memo1.Lines.Text + #10;
end;
// ShowMessage('2:' + IntToStr(Re)); <--this
until LoopStop;
repeat
FillMemory(@BufRecv, 1025, 0);
Re := recvfrom(Skt1, BufRecv, 1024, 0, Addr, AddLen);
LoopStop := (Re = SOCKET_ERROR);
ShowMessage('1:' + IntToStr(Re));
if not (LoopStop) then
begin
Memo1.Lines.Add('data receive from: ' + inet_ntoa(Addr.sin_addr));
for n := 0 to Re - 1 do
begin
if BufRecv[n] = 0 then
Memo1.Lines.Text := Memo1.Lines.Text + (char(94)) //char(^)
else
Memo1.Lines.Text := Memo1.Lines.Text + (char(BufRecv[n]));
end;
Memo1.Lines.Text := Memo1.Lines.Text + #13;
Memo1.Lines.Text := Memo1.Lines.Text + #10;
end;
// ShowMessage('2:' + IntToStr(Re)); <--this
until LoopStop;