Rename Tunnel ID to Channel

This commit is contained in:
Asim Aslam
2019-08-30 20:05:00 +01:00
parent 140c830af1
commit 6fa9d7270f
8 changed files with 246 additions and 164 deletions

View File

@@ -1,10 +1,34 @@
package tunnel
import (
"sync"
"time"
"github.com/google/uuid"
"github.com/micro/go-micro/transport"
)
type link struct {
sync.RWMutex
transport.Socket
// unique id of this link e.g uuid
// which we define for ourselves
id string
// whether its a loopback connection
// this flag is used by the transport listener
// which accepts inbound quic connections
loopback bool
// whether its actually connected
// dialled side sets it to connected
// after sending the message. the
// listener waits for the connect
connected bool
// the last time we received a keepalive
// on this link from the remote side
lastKeepAlive time.Time
}
func newLink(s transport.Socket) *link {
return &link{
Socket: s,