sockets

package
v5.0.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DialSocketWithBackoffs

func DialSocketWithBackoffs(maxBackoffs int, backoff time.Duration, socketPath string) (conn net.Conn, err error)

DialSocketWithBackoffs attempts to connect to the socket in maxBackoffs attempts

func DialSocketWithBackoffsAndProcCheck

func DialSocketWithBackoffsAndProcCheck(
	maxBackoffs int,
	backoff time.Duration,
	socketPath string,
	checkProccessStatus func(string, int, *bytes.Buffer) error,
	procHint string,
	procPid int,
	errBuf *bytes.Buffer,
) (conn net.Conn, err error)

DialSocketWithBackoffsAndProcCheck attempts to connect to the socket in maxBackoffs attempts. After every failure to connect, it makes sure the specified process is alive

func ListenAndWaitOnSocket

func ListenAndWaitOnSocket(errChan chan<- error, listener net.Listener)

ListenAndWaitOnSocket waits for a new connection to the listener and sends any error back through the channel. ListenAndWaitOnSocket is intended to be used as a goroutine

func ReadySocketPath

func ReadySocketPath(runtimeDir, machineName string) string

ReadySocketPath returns the filepath for the ready socket

func SetSocket

func SetSocket(socketLoc *define.VMFile, path string, symlink *string) error

SetSocket creates a new machine file for the socket and assigns it to `socketLoc`

Types

This section is empty.

Jump to

Keyboard shortcuts

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