sock

package
v0.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 19, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

This package sets socket options per OS. Specifically:

  1. It allows SO_REUSEADDR so we can bind on a more specific address when's there's another socket binding to wildcard;
  2. It sets IP_PKTINFO on Linux/Windows, and IP_RECVDSTADDR on FreeBSD, so UDP protocols will get the DST IP (then becomes SRC IP) when sending a return datagram. (https://blog.powerdns.com/2012/10/08/on-binding-datagram-udp-sockets-to-the-any-addresses/)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Control

func Control(network, address string, conn syscall.RawConn) error

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL