procedure TForm1.Button1Click(Sender: TObject);
begin
ClientSocket1.Address := Edit1.Text;
//IP-Adresse
clientsocket1.Active := true;
clientsocket1.Open;
//beides oder nur eins von (active und open)?
end;
procedure TForm1.ServerSocket1ClientRead(Sender: TObject;
Socket: TCustomWinSocket);
begin
Label1.Caption := ServerSocket1.Socket.ReceiveText;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
ClientSocket1.Socket.SendText(Edit2.Text);
end;
procedure TForm1.ServerSocket1ClientConnect(Sender: TObject;
Socket: TCustomWinSocket);
begin
ShowMessage(ServerSocket1.Socket.RemoteAddress);
end;
procedure TForm1.ClientSocket1Connect(Sender: TObject;
Socket: TCustomWinSocket);
begin
ShowMessage('
Try to connect');
end;
procedure TForm1.ClientSocket1Error(Sender: TObject; Socket: TCustomWinSocket;
ErrorEvent: TErrorEvent;
var ErrorCode: Integer);
begin
ShowMessage('
No Connect');
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
serversocket1.port := 10025;
serversocket1.Active := true;
Serversocket1.Open;
end;