commit | 7e93ce5a766064e8dd4fa247ca0cce225bfd9940 | [log] [tgz] |
---|---|---|
author | Suharsh Sivakumar <suharshs@google.com> | Thu May 07 17:46:13 2015 -0700 |
committer | Suharsh Sivakumar <suharshs@google.com> | Thu May 07 17:46:15 2015 -0700 |
tree | 797c47bc539096ac1e813b30bcd41da6d1b6c1a3 | |
parent | fe9b3e9447c5f3d1a9c337d9ebc3bb2e85de8fb2 [diff] |
ref: Add resolver to rpc.RegisterProtocol. When dialing some of our protocols we get a net.Conn with a different (protocol,address) pair than what we asked for. E.g. anything that does DNS resolution will convert the host portion of the address into an IP address. This is annoying, because many times we want to use the (protocol,address) pair as a cache key; i.e. it's used as a VIF cache key. Since the resolved (protocol,address) is only available after calling the dialer, we currently waste resources by actually dialing the address, only to discover the resolved address is already in our cache, and closing the dialed connection. This change introduces a Resolver func to rpc.RegisterProtocol that can be used to perform the DNS lookup without creating a real connection. For protocols that do not have a resolution step, it is just the identity function. closes vanadium/issues#431 MultiPart: 2/2 Change-Id: If9c0de686ea89598fb424fa0f09de91c320a1161
This repository contains a reference implementation of the Vanadium APIs.
Unlike the APIs in https://github.com/vanadium/go.v23, which promises to provide backward compatibility this repository makes no such promises.