S
shm83
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.BitBtn1Click(Sender: TObject);
var strm:TMemoryStream;
p:Array[0..254] of char;
Posi,Len:Integer;
begin
Posi:=0;
strm:=TMemoryStream.Create;
RichEdit1.Lines.SaveToStream(strm);
strm.Seek(0,0);
While Posi<strm.Size do
begin
Len:=255;
if strm.Size-Posi<255 then
Len:=strm.Size-Posi;
strm.ReadBuffer(p,Len);
IdUDPserver1.SendBuffer('127.0.0.1',8001,P,Len);
Inc(Posi,Len);
Application.ProcessMessages;
end;
end;
procedure TForm1.IdUDPServer2UDPRead(Sender: TObject; AData: TStream;
ABinding: TIdSocketHandle);
var
strm2:TMemoryStream;
buf:array [0..254] of char;
Str:String;
begin
strm2:=TMemoryStream.Create;
strm2.Clear;
AData.Seek(0,0);
AData.ReadBuffer(buf[0],adata.size);
RichEdit2.Lines.Add(buf);
end;
end.
var strm:TMemoryStream;
p:Array[0..254] of char;
Posi,Len:Integer;
begin
Posi:=0;
strm:=TMemoryStream.Create;
RichEdit1.Lines.SaveToStream(strm);
strm.Seek(0,0);
While Posi<strm.Size do
begin
Len:=255;
if strm.Size-Posi<255 then
Len:=strm.Size-Posi;
strm.ReadBuffer(p,Len);
IdUDPserver1.SendBuffer('127.0.0.1',8001,P,Len);
Inc(Posi,Len);
Application.ProcessMessages;
end;
end;
procedure TForm1.IdUDPServer2UDPRead(Sender: TObject; AData: TStream;
ABinding: TIdSocketHandle);
var
strm2:TMemoryStream;
buf:array [0..254] of char;
Str:String;
begin
strm2:=TMemoryStream.Create;
strm2.Clear;
AData.Seek(0,0);
AData.ReadBuffer(buf[0],adata.size);
RichEdit2.Lines.Add(buf);
end;
end.