Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can I call an internal JS method without declaring by a callback? Just return parent JS object with methods? #668

Open
bimonsubio1984 opened this issue Nov 2, 2018 · 1 comment

Comments

@bimonsubio1984
Copy link

bimonsubio1984 commented Nov 2, 2018

Public Class FreenomDNS
      Public UserName, Password As String
      Public EdgeFunc As System.Func(Of Object, System.Threading.Tasks.Task(Of Object))
      Public Freenom As Object

      Public Function Authorize(UserName As String, Password As String)
          EdgeFunc = EdgeJs.Edge.Func("
                  var Freenom;
/*
                  ReturnValueFunc=function()
                  {
                      return Freenom;
                  }
*/
                  EdgeFunc=function (data, callback) 
                  { 
                      var UserName=data[0];
                      var Password=data[1];
                      Freenom = require(""freenom-dns"").init(UserName, Password);
                      callback(null, Freenom); 
                  };
                  return EdgeFunc;
          ")
          Freenom = EdgeFunc({UserName, Password}).WaitResult().dns
      End Function

      Function ListRecords(ForDomain As String)
          Dim FreenomFunc As System.Func(Of Object, System.Threading.Tasks.Task(Of Object)) =
                 Freenom.listRecords 'listDomains
          ListRecords = FreenomFunc(ForDomain).WaitResult(5000)
      End Function
  End Class

  Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load
      Dim TestDNS As New FreenomDNS
      TestDNS.Authorize(UserNameConst, PasswordConst)
      Debug.Print(TestDNS.ListRecords(DomainNameConst).ToString())

@bimonsubio1984
Copy link
Author

It hangs on line:
ListRecords = FreenomFunc(ForDomain).WaitResult(5000)

Please let me know, how can I fix the problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant