当前仓库属于暂停状态,部分功能使用受限,详情请查阅 仓库状态说明
2 Star 0 Fork 1

JUMEI_ARCH/go-plugins
暂停

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
utp.go 880 Bytes
一键复制 编辑 原始数据 按行查看 历史
Asim Aslam 提交于 2017-01-09 21:11 . add tls to uTP transport
// Package utp implements a utp transport
package utp
import (
"bufio"
"encoding/gob"
"net"
"time"
"github.com/micro/go-micro/cmd"
"github.com/micro/go-micro/transport"
)
type utpTransport struct {
opts transport.Options
}
type utpListener struct {
t time.Duration
l net.Listener
opts transport.ListenOptions
}
type utpClient struct {
dialOpts transport.DialOptions
conn net.Conn
enc *gob.Encoder
dec *gob.Decoder
encBuf *bufio.Writer
timeout time.Duration
}
type utpSocket struct {
conn net.Conn
enc *gob.Encoder
dec *gob.Decoder
encBuf *bufio.Writer
timeout time.Duration
}
func init() {
cmd.DefaultTransports["utp"] = NewTransport
}
func NewTransport(opts ...transport.Option) transport.Transport {
var options transport.Options
for _, o := range opts {
o(&options)
}
return &utpTransport{opts: options}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/JMArch/go-plugins.git
git@gitee.com:JMArch/go-plugins.git
JMArch
go-plugins
go-plugins
v0.2.0

搜索帮助

0d507c66 1850385 C8b1a773 1850385