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
Complete thread:
- Unable to Connect - Yaser, 2010-07-23, 11:17
- Re: Unable to Connect - wodDamir, 2010-07-23, 11:28
- Re: Unable to Connect - Yaser, 2010-07-23, 11:47
- Re: Unable to Connect - wodDamir, 2010-07-23, 13:10
- Re: Unable to Connect - Yaser, 2010-07-23, 16:48
- Re: Unable to Connect - woddrazen, 2010-07-23, 17:51
- Re: Unable to Connect - Yaser, 2010-07-25, 04:04
- Re: Unable to Connect - Yaser, 2010-07-25, 05:44
- Re: Unable to Connect - Yaser, 2010-07-25, 04:04
- Re: Unable to Connect - woddrazen, 2010-07-23, 17:51
- Re: Unable to Connect - Yaser, 2010-07-23, 16:48
- Re: Unable to Connect - wodDamir, 2010-07-23, 13:10
- Re: Unable to Connect - Yaser, 2010-07-23, 11:47
- Re: Unable to Connect - wodDamir, 2010-07-23, 11:28