gonet

package
v0.0.0-...-a6dae5b Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2017 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Overview

Package gonet provides a Go net package compatible wrapper for a tcpip stack.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

type Conn struct {
	// contains filtered or unexported fields
}

A Conn is a wrapper around a tcpip.Endpoint that implements the net.Conn interface.

func NewConn

func NewConn(wq *waiter.Queue, ep tcpip.Endpoint) *Conn

NewConn creates a new Conn.

func (*Conn) Close

func (c *Conn) Close() error

Close implements net.Conn.Close.

func (*Conn) LocalAddr

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

LocalAddr implements net.Conn.LocalAddr.

func (*Conn) Read

func (c *Conn) Read(b []byte) (int, error)

Read implements net.Conn.Read.

func (*Conn) RemoteAddr

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

RemoteAddr implements net.Conn.RemoteAddr.

func (*Conn) SetDeadline

func (c *Conn) SetDeadline(t time.Time) error

SetDeadline implements net.Conn.SetDeadline.

func (*Conn) SetReadDeadline

func (c *Conn) SetReadDeadline(t time.Time) error

SetReadDeadline implements net.Conn.SetReadDeadline.

func (*Conn) SetWriteDeadline

func (c *Conn) SetWriteDeadline(t time.Time) error

SetWriteDeadline implements net.Conn.SetWriteDeadline.

func (*Conn) Write

func (c *Conn) Write(b []byte) (int, error)

Write implements net.Conn.Write.

type Listener

type Listener struct {
	// contains filtered or unexported fields
}

A Listener is a wrapper around a tcpip endpoint that implements net.Listener.

func NewListener

func NewListener(s tcpip.Stack, addr tcpip.FullAddress, network tcpip.NetworkProtocolNumber) (*Listener, error)

NewListener creates a new Listener.

func (*Listener) Accept

func (l *Listener) Accept() (net.Conn, error)

Accept implements net.Conn.Accept.

func (*Listener) Addr

func (l *Listener) Addr() net.Addr

Addr implements net.Listener.Addr.

func (*Listener) Close

func (l *Listener) Close() error

Close implements net.Listener.Close.

func (*Listener) Shutdown

func (l *Listener) Shutdown()

Shutdown stops the HTTP server.

Jump to

Keyboard shortcuts

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