Skip to content

boljen/msgconn

Repository files navigation

MsgConn (Go)

GoDoc Build Status

Package msgconn implements a wrapper that encodes and decodes variable-length messages to and from a bytestream.

Install

go get github.com/boljen/msgconn
go get gopkg.in/boljen/msgconn.v1

Example

// Creating a new MsgConn instance
tcpConn, _ := ln.AcceptTCP()
conn := &MsgConn{
        Reader: tcpConn,
        Writer: tcpConn,
        Closer: tcpConn,
}

// Reading and writing messages
msg, _ := conn.ReadMessage()
conn.WriteMessage([]byte("message"))

License

This package is released under the MIT license.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages