Skip to content
/ go-utp Public

μTP (Micro Transport Protocol) implementation in Golang

License

Notifications You must be signed in to change notification settings

jbenet/go-utp

Repository files navigation

utp

μTP (Micro Transport Protocol) implementation

Build status Build Status GoDoc

http://www.bittorrent.org/beps/bep_0029.html

warning: This is a buggy alpha version.

Benchmark History

Benchmark status

Installation

go get github.com/h2so5/utp

Example

Echo server

package main

import (
	"time"

	"github.com/h2so5/utp"
)

func main() {
	ln, _ := utp.Listen("utp", ":11000")
	defer ln.Close()

	conn, _ := ln.AcceptUTP()
	conn.SetKeepAlive(time.Minute)
	defer conn.Close()
	
	for {
		var buf [1024]byte
		l, err := conn.Read(buf[:])
		if err != nil {
			break
		}
		_, err = conn.Write(buf[:l])
		if err != nil {
			break
		}
	}
}

About

μTP (Micro Transport Protocol) implementation in Golang

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published