NewControlStream returns a new instance of ControlStreamHandler
(
observer *Observer,
connectedFuse ConnectedFuse,
tunnelProperties *TunnelProperties,
connIndex uint8,
edgeAddress net.IP,
registerClientFunc registerClientFunc,
registerTimeout time.Duration,
gracefulShutdownC <-chan struct{},
gracePeriod time.Duration,
protocol Protocol,
)
| 47 | |
| 48 | // NewControlStream returns a new instance of ControlStreamHandler |
| 49 | func NewControlStream( |
| 50 | observer *Observer, |
| 51 | connectedFuse ConnectedFuse, |
| 52 | tunnelProperties *TunnelProperties, |
| 53 | connIndex uint8, |
| 54 | edgeAddress net.IP, |
| 55 | registerClientFunc registerClientFunc, |
| 56 | registerTimeout time.Duration, |
| 57 | gracefulShutdownC <-chan struct{}, |
| 58 | gracePeriod time.Duration, |
| 59 | protocol Protocol, |
| 60 | ) ControlStreamHandler { |
| 61 | if registerClientFunc == nil { |
| 62 | registerClientFunc = tunnelrpc.NewRegistrationClient |
| 63 | } |
| 64 | return &controlStream{ |
| 65 | observer: observer, |
| 66 | connectedFuse: connectedFuse, |
| 67 | tunnelProperties: tunnelProperties, |
| 68 | registerClientFunc: registerClientFunc, |
| 69 | registerTimeout: registerTimeout, |
| 70 | connIndex: connIndex, |
| 71 | edgeAddress: edgeAddress, |
| 72 | gracefulShutdownC: gracefulShutdownC, |
| 73 | gracePeriod: gracePeriod, |
| 74 | protocol: protocol, |
| 75 | } |
| 76 | } |
| 77 | |
| 78 | func (c *controlStream) ServeControlStream( |
| 79 | ctx context.Context, |
no outgoing calls