MCPcopy
hub / github.com/grafana/dskit / GetAutoBindPort

Method GetAutoBindPort

kv/memberlist/tcp_transport.go:388–392  ·  view source on GitHub ↗

GetAutoBindPort returns the bind port that was automatically given by the kernel, if a bind port of 0 was given.

()

Source from the content-addressed store, hash-verified

386// GetAutoBindPort returns the bind port that was automatically given by the
387// kernel, if a bind port of 0 was given.
388func (t *TCPTransport) GetAutoBindPort() int {
389 // We made sure there's at least one TCP listener, and that one's
390 // port was applied to all the others for the dynamic bind case.
391 return t.tcpListeners[0].Addr().(*net.TCPAddr).Port
392}
393
394// FinalAdvertiseAddr is given the user's configured values (which
395// might be empty) and returns the desired IP and port to advertise to

Calls

no outgoing calls