netString

package module
v0.0.0-...-a95951c Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2019 License: LGPL-3.0 Imports: 4 Imported by: 0

README

netstring

Simple netstring server and client in go. Netstring is a simple protocol. See Wikipedia to more info.

Installation

go get  https://github.com/elektro79/netstring

How to use

See test for complete use. You must implement NetStringProcessor. You also must change netstring.MaxMsg to avoid a malicius client eat all ram

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NetString

type NetString struct {
	MaxMsg uint64
	// contains filtered or unexported fields
}

func (*NetString) Connect

func (n *NetString) Connect(conn net.Conn)

func (*NetString) Listen

func (n *NetString) Listen(ln net.Listener) error

type NetStringConn

type NetStringConn struct {
	Conn   net.Conn
	MaxMsg uint64
	// contains filtered or unexported fields
}

func (*NetStringConn) Send

func (n *NetStringConn) Send(s string)

type NetStringProcessor

type NetStringProcessor interface {
	Connected(*NetStringConn)
	Msg(*NetStringConn, string)
	Disconected(*NetStringConn, error)
}

Jump to

Keyboard shortcuts

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