Go proposal: Context-aware Dialer methods
antonz.org·5h·
Flag this post

Part of the Accepted! series, explaining the upcoming Go changes in simple terms.

Add context-aware, network-specific methods to the net.Dialer type.

Ver. 1.26 • Stdlib • Low impact

Summary

The net.Dialer type connects to the address using a given network (protocol) — TCP, UDP, IP, or Unix sockets.

The new context-aware Dialer methods (DialTCP, DialUDP, DialIP, and DialUnix) combine the efficiency of the existing network-specific net functions (which skip address resolution and dispatch) with the cancellation capabilities of Dialer.DialContext.

Motivation

The net package already has top-level functions for different networks (DialTCP, DialUDP, DialIP, and DialUnix), but these were made before `…

Similar Posts

Loading similar posts...