inherit_net

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2022 License: Apache-2.0, MIT Imports: 7 Imported by: 0

Documentation

Overview

Package inherit_net provides a family of Listen functions that either open a fresh connection or provide an inherited connection from when the process was started. The behave like their counterparts in the net package, but transparently provide support for graceful restarts without dropping connections. This is provided in a systemd socket activation compatible form to allow using socket activation.

BUG: Doesn't handle closing of listeners.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Append

func Append(ln net.Listener) error

Append append listener to inheritNet.active

func Listen

func Listen(nett, laddr string) (net.Listener, error)

Listen announces on the local network address laddr. The network net must be a stream-oriented network: "tcp", "tcp4", "tcp6", "unix" or "unixpacket". It returns an inherited net.Listener for the matching network and address, or creates a new one using net.Listen.

func ListenTCP

func ListenTCP(nett string, laddr *net.TCPAddr) (*net.TCPListener, error)

ListenTCP announces on the local network address laddr. The network net must be: "tcp", "tcp4" or "tcp6". It returns an inherited net.Listener for the matching network and address, or creates a new one using net.ListenTCP.

func ListenUnix

func ListenUnix(nett string, laddr *net.UnixAddr) (*net.UnixListener, error)

ListenUnix announces on the local network address laddr. The network net must be a: "unix" or "unixpacket". It returns an inherited net.Listener for the matching network and address, or creates a new one using net.ListenUnix.

func SetInherited

func SetInherited() error

SetInherited adds the files and envs to be inherited by the new process. NOTE:

Only for reboot!
Windows system are not supported!

Types

This section is empty.

Jump to

Keyboard shortcuts

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