I would add it as a new constructor to InternetAddress.

In the mean time, you could work around the lack of it by making a new subclass of InternetAddress that sets the member with your constructor. Like:

class MyInternetAddress : InternetAddress {
   this(sockaddr_in addr) {
      this.sin = addr;
   }
}


and I think that will work. (Looking at the source, the sin member is protected which means a subclass can get at it.)

Then you just pass it everywhere InternetAddress is expected and it ought to just work.

Reply via email to