safesocket

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2020 License: BSD-3-Clause Imports: 12 Imported by: 28

Documentation

Overview

Package safesocket creates either a Unix socket, if possible, or otherwise a localhost TCP connection.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnCloseRead

func ConnCloseRead(c net.Conn) error

ConnCloseRead calls c's CloseRead method. c is expected to be either a UnixConn or TCPConn as returned from this package.

func ConnCloseWrite

func ConnCloseWrite(c net.Conn) error

ConnCloseWrite calls c's CloseWrite method. c is expected to be either a UnixConn or TCPConn as returned from this package.

func Connect

func Connect(path string, port uint16) (net.Conn, error)

Connect connects to either path (on Unix) or the provided localhost port (on Windows).

func Listen

func Listen(path string, port uint16) (_ net.Listener, gotPort uint16, _ error)

Listen returns a listener either on Unix socket path (on Unix), or the localhost port (on Windows). If port is 0, the returned gotPort says which port was selected on Windows.

Types

This section is empty.

Jump to

Keyboard shortcuts

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