Unable to Connect - WeOnlyDo Discussion board

Unable to Connect (General questions)

by Yaser, Friday, July 23, 2010, 11:17 (5236 days ago)

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

Re: Unable to Connect

by wodDamir, Friday, July 23, 2010, 11:28 (5236 days ago) @ Yaser

Yaser,

I can't tell without seeing the actual error. Can you please show me the exact error returned thru ErrorText / ErrorCode?

Also, did you click Search on both clients at the same time?

One more thing, did you try compiling our sample, and trying it out on these machines?

Regards,
Damba

Re: Unable to Connect

by Yaser, Friday, July 23, 2010, 11:47 (5236 days ago) @ wodDamir

Yaser,

I can't tell without seeing the actual error. Can you please show me the exact error returned thru ErrorText / ErrorCode?

Also, did you click Search on both clients at the same time?

One more thing, did you try compiling our sample, and trying it out on these machines?

Regards,
Damba

Hello Damba,

No I did not click Search at the same time. But it is 4-5 seconds apart. Will that make a difference ? Secondly, in the real world, it is highly unlikely 2 computers will click Search at the same exact moment, so how does one resolve this issue?

Error Code:1428 Error Text: 10.0.0.20

Thanks

Yaser

Re: Unable to Connect

by wodDamir, Friday, July 23, 2010, 13:10 (5236 days ago) @ Yaser

Yaser,

Is that our sample, or your own code?

Can you try the sample?

If that doesn't work, can you please send me the source code, so I could try duplicating this on my side?

You can send a sample to techsupport@weonlydo.com

Regards,
Damba

Re: Unable to Connect

by Yaser, Friday, July 23, 2010, 16:48 (5236 days ago) @ wodDamir

Yaser,

Is that our sample, or your own code?

Can you try the sample?

If that doesn't work, can you please send me the source code, so I could try duplicating this on my side?

You can send a sample to techsupport@weonlydo.com

Regards,
Damba

Hello Damba,

This is my source code that I provided. I put location 1 code on one machine and location 2 code on another machine. However, since I am using COM I am wondering if I have to include the LicenseKey property to make it work ?

Also the sample code (simple1) always times out.

Thanks

Yaser

Re: Unable to Connect

by woddrazen, Friday, July 23, 2010, 17:51 (5236 days ago) @ Yaser

Yaser,


Yes you must use LicenseKey Property for COM version. Please add it at beginning of your wodVPN code.

More help you can fin here:
http://www.weonlydo.com/VPN/Help/Technical.html

Also if you are using Delphi 6, wodVPN parameters inside Events is not listed in correct order. So you need to change that inside WODVPNCOMLib_TLB.pas file.

You can send us email to techsuppport@weonlydo.com and we can send you changed WODVPNCOMLib_TLB.pas file that should work. That will probably fix your problem. I just try this out and 1. Simple sample works as expected.


Drazen

Re: Unable to Connect

by Yaser, Sunday, July 25, 2010, 04:04 (5234 days ago) @ woddrazen

Yaser,


Yes you must use LicenseKey Property for COM version. Please add it at beginning of your wodVPN code.

More help you can fin here:
http://www.weonlydo.com/VPN/Help/Technical.html

Also if you are using Delphi 6, wodVPN parameters inside Events is not listed in correct order. So you need to change that inside WODVPNCOMLib_TLB.pas file.

You can send us email to techsuppport@weonlydo.com and we can send you changed WODVPNCOMLib_TLB.pas file that should work. That will probably fix your problem. I just try this out and 1. Simple sample works as expected.


Drazen

Hello can u please tell me if your mediator is running ? Drazzel and Damba I left u 3 messages on my open ticket.

Also Drazzel, the project1.exe that u sent me and as working yesterday without any problem is no longer working :-( I can think it must be the mediator. As I mentioned in my emails, the OnSearchEvent is never fired.

Thank you

Yaser

Re: Unable to Connect

by Yaser, Sunday, July 25, 2010, 05:44 (5234 days ago) @ Yaser

Yaser,


Yes you must use LicenseKey Property for COM version. Please add it at beginning of your wodVPN code.

More help you can fin here:
http://www.weonlydo.com/VPN/Help/Technical.html

Also if you are using Delphi 6, wodVPN parameters inside Events is not listed in correct order. So you need to change that inside WODVPNCOMLib_TLB.pas file.

You can send us email to techsuppport@weonlydo.com and we can send you changed WODVPNCOMLib_TLB.pas file that should work. That will probably fix your problem. I just try this out and 1. Simple sample works as expected.


Drazen

Hello can u please tell me if your mediator is running ? Drazzel and Damba I left u 3 messages on my open ticket.

Also Drazzel, the project1.exe that u sent me and as working yesterday without any problem is no longer working :-( I can think it must be the mediator. As I mentioned in my emails, the OnSearchEvent is never fired.

Thank you

Yaser

Hello,

I figured out why the OnSearchEvent was not getting called. I had set RetryCount to Zero. I set it to 30 seconds and now the OnSearhEvent does fire. ErrorCode returns back 1460 -----> Timeout

When the project Drazzel had sent me, it connected immedietly. Why the reason for the timeout ?? The license key is correct and is entered inside the code before the Start(0) method.

Thank you

Yaser