ncnet

package
v0.0.0-...-f3d8a94 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

The netchanrpc package makes it possible to run an RPC service over netchan.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dial

func Dial(imp *netchan.Importer, service string) (net.Conn, error)

Dial makes a connection to the named netchan service, which must have been previously exported with a call to Listen.

func Listen

func Listen(exp *netchan.Exporter, service string) (net.Listener, error)

Listen uses the given Exporter to listen on the given service name. It uses a set of netchan channels, all prefixed with that name. The connections returned by the Listener have underlying type *Conn. This can be used to gain access to the underlying channels.

Types

type Conn

type Conn struct {
	R <-chan []byte
	W chan<- []byte
	// contains filtered or unexported fields
}

Conn represents a netchan connection. R and W hold the channels used by the connection. The Read and Write methods use them to receive and send data. The W channel should not be closed - it will be closed when Close is called on the connection itself.

func (*Conn) Close

func (c *Conn) Close() error

func (*Conn) LocalAddr

func (c *Conn) LocalAddr() net.Addr

func (Conn) Read

func (r Conn) Read(buf []byte) (int, error)

func (*Conn) RemoteAddr

func (c *Conn) RemoteAddr() net.Addr

func (*Conn) SetReadTimeout

func (c *Conn) SetReadTimeout(nsec int64) error

func (*Conn) SetTimeout

func (c *Conn) SetTimeout(nsec int64) error

func (*Conn) SetWriteTimeout

func (c *Conn) SetWriteTimeout(nsec int64) error

func (Conn) Write

func (w Conn) Write(buf []byte) (n int, err error)

Jump to

Keyboard shortcuts

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