You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I write net.Dial, eventually net.Dialer.DialContext will be called. The latter invocation allows users to pass a context.Context to the Dial function, and cancel the Dial at the time the context is canceled.
If I call net.DialUnix, under the hood a context.Context is immediately invoked:
However, as currently written you can't plumb through your own context.
It would be nice if a DialUnixContext(context.Context, network string, laddr, raddr *UnixAddr) function was added to the API that indicated to end users that a blocking I/O operation was about to proceed, and allowed callers to cancel the request on demand.
Alternatively, a *UnixDialer could be added, with a single DialContext method. This would allow the possibility of later configuring the behavior of the dialer.
Alternatively, there is another call to dialUnix buried deep in the guts of the *sysDialer code, which gets called from Dial... perhaps if there were clearer instructions on how to use net.Dial to achieve the same behavior as the DialUnix function, we could accomplish it without a separate API.
The text was updated successfully, but these errors were encountered:
If I write
net.Dial
, eventuallynet.Dialer.DialContext
will be called. The latter invocation allows users to pass a context.Context to the Dial function, and cancel the Dial at the time the context is canceled.If I call
net.DialUnix
, under the hood a context.Context is immediately invoked:However, as currently written you can't plumb through your own context.
It would be nice if a
DialUnixContext(context.Context, network string, laddr, raddr *UnixAddr)
function was added to the API that indicated to end users that a blocking I/O operation was about to proceed, and allowed callers to cancel the request on demand.Alternatively, a
*UnixDialer
could be added, with a singleDialContext
method. This would allow the possibility of later configuring the behavior of the dialer.Alternatively, there is another call to
dialUnix
buried deep in the guts of the*sysDialer
code, which gets called from Dial... perhaps if there were clearer instructions on how to usenet.Dial
to achieve the same behavior as the DialUnix function, we could accomplish it without a separate API.The text was updated successfully, but these errors were encountered: