ymmuse / vnet

establishing virtual persistent connection based on a native tcp connection

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

What is this?

vnet can establish virtual connections of client based on a native tcp connection from the front server.

Build Status GoDoc

Example

The Dial function connects to a server:

import "vnet"

conn, err := vnet.Dial("tcp", "127.0.0.1:8080")
if err != nil {
	// handle error
}

// ...

The Listen function creates servers:

import "vnet"

ln, err := vnet.Listen("tcp", ":8080")
if err != nil {
	// handle error
}
for {
	conn, err := ln.Accept()
	if err != nil {
		// handle error
	}
	go handleConnection(conn)
}

Benchmark

cd this.repo.dir
go test -bench .

About

establishing virtual persistent connection based on a native tcp connection


Languages

Language:Go 100.0%