NativeScript / NativeScript/ios

interop.Reference() issues

Open
#103 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
150
Forks
43
Avg merge
3d 10h
Merged PRs (30d)
22

Description

I'm in the process of updating a copy of 'nativescript-zeroconf' plugin for NS7, and long story short, i can't acquire IP addresses. After some digging around, i found that this line was the root of my issues:

let socket_address = new interop.Reference(sockaddr_in, socketData.bytes).value;
console.log(socket_address); // <Pointer: 0x6000033c8350>

This line of code used to work in NS6 with the old runtime, but now it just seems to return the pointer without been able to access any properties of the pointer.

eg, this used to work in NS6 returned 2 (AF_INET), but now returns undefined:

console.log(socket_address.sin_family) // undefined

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the interop.Reference(sockaddr_in, socketData.bytes) example from the issue and inspect how the returned Pointer is exposed. No repository file or test is named; done means the sockaddr_in fields, including sin_family, are accessible in the NS7 runtime and the reported IP-address use case works.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, javascript
Domain
mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.