A
adomy
Unregistered / Unconfirmed
GUEST, unregistred user!
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ScktComp, StdCtrls;
type
TForm1 = class(TForm)
ClientSocket1: TClientSocket;
ServerSocket1: TServerSocket;
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
type TM_Server = class (TThread)
private
FServer:TServerSocket;
protected
procedure Execute();override;
Constructor Create();
// Destructor Destroy();
public
end;
type TM_Client = class (TThread)
private
FClient:TClientSocket;
protected
procedure Execute();override;
constructor Create();
// Destructor Destroy();
public
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
{ TM_Server }
constructor TM_Server.Create;
begin
FreeOnTerminate:=True;
FServer.ServerType:=stNonBlocking;
FServer.Port:=6666
end;
{
destructor TM_Server.Destroy;
begin
end;
}
procedure TM_Server.Execute;
begin
inherited;
FServer.Active:=True;
end;
{ TM_Client }
constructor TM_Client.Create;
begin
FreeOnTerminate:=True;
FClient.ClientType:=ctNonBlocking;
FClient.Address:='127.0.0.1';
FClient.Port:=6666;
FClient.Active:=True;
end;
{
destructor TM_Client.Destroy;
begin
end;
}
procedure TM_Client.Execute;
begin
inherited;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
S:TM_Server;
begin
S:=TM_Server.Create;
end;
procedure TForm1.Button2Click(Sender: TObject);
var
C:TM_Client;
begin
C:=TM_Client.Create;
end;
end.
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ScktComp, StdCtrls;
type
TForm1 = class(TForm)
ClientSocket1: TClientSocket;
ServerSocket1: TServerSocket;
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
type TM_Server = class (TThread)
private
FServer:TServerSocket;
protected
procedure Execute();override;
Constructor Create();
// Destructor Destroy();
public
end;
type TM_Client = class (TThread)
private
FClient:TClientSocket;
protected
procedure Execute();override;
constructor Create();
// Destructor Destroy();
public
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
{ TM_Server }
constructor TM_Server.Create;
begin
FreeOnTerminate:=True;
FServer.ServerType:=stNonBlocking;
FServer.Port:=6666
end;
{
destructor TM_Server.Destroy;
begin
end;
}
procedure TM_Server.Execute;
begin
inherited;
FServer.Active:=True;
end;
{ TM_Client }
constructor TM_Client.Create;
begin
FreeOnTerminate:=True;
FClient.ClientType:=ctNonBlocking;
FClient.Address:='127.0.0.1';
FClient.Port:=6666;
FClient.Active:=True;
end;
{
destructor TM_Client.Destroy;
begin
end;
}
procedure TM_Client.Execute;
begin
inherited;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
S:TM_Server;
begin
S:=TM_Server.Create;
end;
procedure TForm1.Button2Click(Sender: TObject);
var
C:TM_Client;
begin
C:=TM_Client.Create;
end;
end.