peerstream_transport

package
Version: v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2015 License: MIT, MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

type Conn interface {
	io.Closer

	// IsClosed returns whether a connection is fully closed, so it can
	// be garbage collected.
	IsClosed() bool

	// OpenStream creates a new stream.
	OpenStream() (Stream, error)

	// Serve starts listening for incoming requests and handles them
	// using given StreamHandler
	Serve(StreamHandler)
}

Conn is a stream-multiplexing connection to a remote peer.

type Stream

type Stream interface {
	io.Reader
	io.Writer
	io.Closer
}

Stream is a bidirectional io pipe within a connection

type StreamHandler

type StreamHandler func(Stream)

StreamHandler is a function that handles streams (usually those opened by the remote side)

type Transport

type Transport interface {

	// NewConn constructs a new connection
	NewConn(c net.Conn, isServer bool) (Conn, error)
}

Transport constructs go-peerstream compatible connections.

Source Files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL