Newsgroups : Borland : borland.public.delphi.internet.winsock : 2007 Feb : Re: UDPServer freezes (AntiFreeze doens't help much)
| Subject: | Re: UDPServer freezes (AntiFreeze doens't help much) |
| Posted by: | "Samu" (samuel.lop..@telefonica.net) |
| Date: | 5 Feb 2007 12:33:04 |
>Please show your actual code.
>
>
>Gambit
procedure TForm1.serviUDPRead(Sender: TObject; AData: TStream;
ABinding: TIdSocketHandle);
var
x,y:string[3];
dat:string[7];
begin
anti.process;
//anti is the IdAntiFreeze
dat:=servi.ReceiveString(-1);
if dat='!' then
begin
dib.canvas.Rectangle(-50,-50,900,900);
anti.process;
exit;
end;
//i want the ! to clean up the painting board (dib)
if dat='&' then
begin
ta:=true;
anti.process;
exit;
end;
//& is sent every OnMouseUp in the client program
x:=dat[1]+dat[2]+dat[3];
y:=dat[5]+dat[6]+dat[7];
//these are the coordinates sent. They seem to work alright.
if ta=false
then
begin
dib.Canvas.lineto(strtoint(x),strtoint(y));
dib.Canvas.moveto(strtoint(x),strtoint(y));
end
else
begin
dib.Canvas.moveto(strtoint(x),strtoint(y));
dib.Canvas.lineto(strtoint(x),strtoint(y));
ta:=false;
end;
anti.process;
end;
Thanks again for the attention :)