unit serverq;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, IdBaseComponent, IdComponent,
IdTCPServer, IdResourceStrings, IdStack, IdGlobal, IdSocketHandle,
IdIPWatch;
type
TForm1 =
class(TForm)
IdTCPServer1: TIdTCPServer;
Edit2: TEdit;
Button1: TButton;
Label1: TLabel;
IdIPWatch1: TIdIPWatch;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
Binding : TIdSocketHandle;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
Label1.Caption := idIPWatch1.LocalIP + '
:';
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
IdTCPServer1.Bindings.Clear;
Binding := IdTCPServer1.Bindings.Add;
Binding.IP := idIPWatch1.LocalIP;
Binding.Port := 9099;
Button1.Enabled := false;
end;
end.