ch

package
v0.0.0-...-6e72739 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2014 License: MIT Imports: 5 Imported by: 0

README

A channel Wrapper for net.Conn

Documentation

godoc.org/github.com/apokalyptik/go/net/ch

Example Usage

I made a tcpip based echo server to show you how to use this package in the most simple fashion possible

View the code

echoServer/main.go

Run the test server

go get github.com/apokalyptik/go/net/ch/echoServer

Documentation

Overview

Package ch provides a handy wrapper mechanism for using a net.Conn via channels. This is currently only for text based streams where input is terminated via \r\n. See echoServer/main.go for an example of using this package

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

type Conn struct {
	In  chan string // Client input strings come down this channel
	Out chan string // Strings sent to this channel are relayed to the client
	Err chan string // This channel is closed when the connection is closed.
	// contains filtered or unexported fields
}

Conn wraps a net.Conn and provides convenient in, out, and error channels.

func New

func New(c net.Conn) *Conn

New returns a pointer to a new ch.Conn structure initialized and working.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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