arpcext

module
v0.0.0-...-8eade3a Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2020 License: MIT

README

arpc extension

GoDoc MIT licensed Build Status Go Report Card Coverage Statusd

API Examples

QUIC Listen, Accept, Read
import "github.com/lesismal/arpcext/quic"

ln, err := quic.Listen(":8888", somTLSConfig)
if err != nil {
    log.Fatalf("failed to listen: %v", err)
}
defer ln.Close()

conn, err := ln.Accept()
buf := make([]byte, 1024)
nread, err := conn.Read(buf)
if err != nil {
    log.Fatalf("failed to listen: %v", err)
}
log.Println(string(buf[:nread]))
QUIC Dial, Write
import "github.com/lesismal/arpcext/quic"

tlsConf := &tls.Config{
    InsecureSkipVerify: true,
    NextProtos:         []string{"quic-echo-example"},
}
conn, err := quic.Dial(addr, tlsConf, nil, 0)
if err != nil {
    log.Fatalf("failed to listen: %v", err)
}
defer conn.Close()
_, err := conn.Write([]byte("hello"))
if err != nil {
    log.Fatalf("failed to listen: %v", err)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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