Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StreamServer ¶
type StreamServer interface { // Performs initial connection and setup, entering a listening state. Listen() error // Address returns a string that can be used by the "streamclient" package to // return a client for this StreamServer. // // Full package is: // github.com/luci/luci-go/logdog/butlerlib/streamclient // // Address may only be called while the StreamServer is actively listening. Address() string // Blocks, returning a new Stream when one is available. If the stream server // has closed, this will return nil. Next() (io.ReadCloser, *streamproto.Properties) // Closes the stream server, cleaning up resources. Close() }
StreamServer is an interface to a backgound service that allows external processes to establish Butler streams.
func NewTCP4Server ¶
func NewTCP4Server(ctx context.Context, spec string) (StreamServer, error)
NewTCP4Server creates a new TCP/IP4 stream server.
spec is a string of the form [addr][:port].
If addr is not empty, it will be an IPv4 network address to bind to. If it is empty, the StreamServer will bind exclusively to localhost.
port must be a valid, available port. It may be omitted or <=0, in which case an ephemeral port will be chosen by the system. Note that, in this case, the caller cannot prescribe the port in advance, and must discover it via exported stream server parameters (externally) or by calling Address (internally).
func NewTCP6Server ¶
func NewTCP6Server(ctx context.Context, spec string) (StreamServer, error)
NewTCP6Server creates a new TCP/IP6 stream server.
spec is a string of the form [addr][:port].
If addr is not empty, it will be an IPv6 network address to bind to. If it is empty, the StreamServer will bind exclusively to localhost.
port must be a valid, available port. It may be omitted or <=0, in which case an ephemeral port will be chosen by the system. Note that, in this case, the caller cannot prescribe the port in advance, and must discover it via exported stream server parameters (externally) or by calling Address (internally).