unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, IdUDPServer,
IdUDPClient, IdSocketHandle, IdGlobal;
type
{ TForm1 }
TForm1 = class(TForm)
Button1: TButton;
Edit1: TEdit;
IdUDPClient1: TIdUDPClient;
IdUDPServer1: TIdUDPServer;
Memo1: TMemo;
procedure Button1Click(Sender: TObject);
procedure IdUDPServer1UDPRead(AThread: TIdUDPListenerThread;
const AData: TIdBytes; ABinding: TIdSocketHandle);
private
public
end;
var
Form1: TForm1;
Msg: string;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.Button1Click(Sender: TObject);
begin
IdUDPClient1.Send(Edit1.Text);
Memo1.Lines.Add('You: ' + Edit1.Text);
Edit1.Clear;
end;
procedure TForm1.IdUDPServer1UDPRead(AThread: TIdUDPListenerThread;
const AData: TIdBytes; ABinding: TIdSocketHandle);
begin
if BytesToString(AData) <> 'Hello' then begin
ABinding.SendTo(ABinding.PeerIP, ABinding.PeerPort, ToBytes(Byte(0)));
end;
Memo1.Lines.Add(ToHex(AData));
Memo1.Lines.Add('ser>>'+BytesToString(AData));
//Memo1.GoToTextEnd;
end;
end.
https://intellipaat.com/blog/database-partitioning-techniques
No comments:
Post a Comment
Коментар: