Unable to Connect (General questions)
Hello,
Can someone please tell me why I am unable to connect ? Here is my code:
Location 1
----------
procedure TForm1.FormActivate(Sender: TObject);
begin
With (WodVPNCom1) Do
BEGIN
RetryWait := 1000 ;
RetryCount := 0 ;
MyID := 'Location1' ;
Password := 'First' ;
Start(0) ;
END ;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
With (WodVPNCom1) Do
Search(SrchUDPSingle, 'Location2', 'mediator.weonlydo.com', 8000) ;
end;
procedure TForm1.wodVPNCom1SearchDone(Sender: TObject; var IP: OleVariant; Port, ErrorCode: Integer; var ErrorText: OleVariant);
begin
If (ErrorCode <> 0) Then
ShowMessage('Error Code: ' + IntToStr(ErrorCode) + ' Error Text:' + ErrorText)
Else
BEGIN
With (WodVPNCom1) Do
Connect1(IP, Port) ;
END ;
end;
procedure TForm1.wodVPNCom1Connected(Sender: TObject; var PeerID,
IP: OleVariant; Port: Integer);
begin
ShowMessage('CONNECTED') ;
end;
Location 2
----------
procedure TForm1.FormActivate(Sender: TObject);
begin
With (WodVPNCom1) Do
BEGIN
RetryWait := 1000 ;
RetryCount := 0 ;
MyID := 'Location2' ;
Password := 'First' ;
Start(0) ;
END ;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
With (WodVPNCom1) Do
Search(SrchUDPSingle, 'Location1', 'mediator.weonlydo.com', 8000) ;
end;
procedure TForm1.wodVPNCom1SearchDone(Sender: TObject; var IP: OleVariant; Port, ErrorCode: Integer; var ErrorText: OleVariant);
begin
If (ErrorCode <> 0) Then
ShowMessage('Error Code: ' + IntToStr(ErrorCode) + ' Error Text:' + ErrorText)
Else
BEGIN
With (WodVPNCom1) Do
Connect1(IP, Port) ;
END ;
end;
procedure TForm1.wodVPNCom1Connected(Sender: TObject; var PeerID,
IP: OleVariant; Port: Integer);
begin
ShowMessage('CONNECTED') ;
end;
This is written in Delphi 6.
When I click the Search button on both machines, I get the ShowMessage from the OnSearchDone event. However the ErrorText looks like a well formatted IP Address.
Thank you