conn

package
v0.0.0-...-b5d8682 Latest Latest
Warning

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

Go to latest
Published: May 1, 2019 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ServeTCP

func ServeTCP(ctxFact func() HoContext, addr string, cb func(*net.TCPListener)) (err error)

Serve with a hosting context factory, at specified local address (host:port)

`cb` will be called with the created `*net.TCPListener`, it's handful to specify port as 0, and receive the actual port from the cb.

This func won't return until the listener is closed.

Types

type TCPConn

type TCPConn struct {
	Hosting
	Posting
	Conn *net.TCPConn
}

func DialTCP

func DialTCP(ctx HoContext, addr string) (hbic *TCPConn, err error)

Connect to specified remote address (host+port) with a hosting context.

The returned `*hbi.TCPConn` embeds an `hbi.Hosting` interface and an `hbi.Posting` interface.

func (*TCPConn) Cancel

func (hbic *TCPConn) Cancel(err error)

func (*TCPConn) Close

func (hbic *TCPConn) Close()

Jump to

Keyboard shortcuts

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