## Problem and outcome Stale ICE and transport callbacks, interrupted media ownership, and optional encoder capabilities could break otherwise recoverable sharing sessions. This maintenance phase corrects those owners across Web, Native and embedded SFU, improves current-state diagnostics, and finishes the affected UI and documentation animation paths. Android, QR invitations and App/Server headline presentation stay on their feature branch. This PR contains the accepted maintenance scope only. ## Release notes **Play together. Your turn!** Approved friends can play together with shared keyboard and mouse controls or optional gamepads. **远程同乐,轮到你啦!** 获准的朋友可以共用键鼠,或使用可选手柄,一起玩本地多人游戏。 ### English This maintenance update improves connection recovery, capture compatibility and troubleshooting for existing Piik rooms. - Keep ICE candidates and gathering completion tied to their current connection. Preserve Viewer route preferences through reconnection and retry newly available Peer opportunities after SFU fallback. - Correct picture and voice ownership during restart, source replacement and connection retirement. Report failed picture dependencies while keeping room voice available. - Separate capture and forwarding statistics and isolate pooled sender attachment failures. - Improve Windows H.264 compatibility with optional encoder properties, retain safe capture failure codes, and keep shared sound volume usable without microphone support. - Improve remote input continuity and mouse responsiveness after idle. - Fix fullscreen handling in some mobile browsers, source-picker refresh, delayed chat confirmations, starred-site startup and local App requests. Refine control motion and reduced-motion behavior. - Restore the mascot's face and shared animation lifecycle in the documentation header. - Include current connection and playback state in diagnostic exports, update Zod to 4.6.6 and simplify shared lifecycle code. Existing 2.x protocols, configuration and default quality settings are preserved. ### 中文 本次维护更新改善现有房间的连接恢复、采集兼容性和故障诊断。 - ICE 候选和收集结束事件跟随当前连接;重连保留观众线路偏好,SFU 兜底后出现新的可用 P2P 机会仍可尝试。 - 修正重启、换源和连接结束时的画面与语音生命周期;语音继续时,画面失败会明确反馈。 - 区分采集与转发统计,隔离编码池中单个输出连接的失败。 - 改善 Windows H.264 可选属性兼容性,保留有效的采集失败原因;没有麦克风能力时也能调整共享声音音量。 - 修复部分移动浏览器全屏、选源刷新、迟到聊天确认、收藏站点启动和本机 App 请求问题,打磨控件动效及减少动态效果行为。 - 修复文档导航 mascot 面部一直隐藏的问题,接回共用动画生命周期。 - 诊断导出补取当前连接与播放状态,升级 Zod 至 4.6.6,精简共用生命周期代码。 沿用现有 2.x 协议、配置和画质默认值。Android、二维码邀请及 App/Server 新增的 HEADLINE 展示留待后续版本。 ## Verification - `npm run check`: type-check, 98 test files / 1,765 tests, production Web build passed. - `npm run check:go-core`: Go formatting, tests, vet, Windows/Linux builds passed; Darwin builds require the native CI runners. - `npm run check:native`: current Windows capture compilation, fixtures and capability probe passed. - `npm run build:website`, TypeScript and repository hygiene checks passed after the documentation-brand fix. - Existing controlled media lifecycle and P2P/SFU voice acceptance covered the retained route/transport changes. Final local browser acceptance covered actual sharing and pause/resume, fullscreen, source refresh, voice/keyboard/settings, 320px to desktop layouts, both themes and all presentation modes. Documentation brand was reproduced broken, then verified on load, replay and reduced motion. - Independent scoped reviews found no integration blocker. ## Impact Patch release v2.4.1. Existing 2.x wire, configuration, authority, capacity and default quality contracts remain intact; no data migration. Source volume no longer depends on microphone availability. Zod 4.6.6 fixes GHSA-mrhx-c7xc-m3w5. The device-specific Windows reports #495 and #452 remain under investigation; this PR improves compatibility and diagnostics without claiming those reports fully resolved. Physical macOS acceptance remains with its native runner/device checks.
507 lines
16 KiB
Go
507 lines
16 KiB
Go
package mediaedge
|
|
|
|
import (
|
|
"context"
|
|
"errors"
|
|
"io"
|
|
"log/slog"
|
|
"strconv"
|
|
"strings"
|
|
"sync"
|
|
"time"
|
|
|
|
"github.com/TNTcraftHIM/Piik/internal/app/nativeaudio"
|
|
"github.com/TNTcraftHIM/Piik/internal/diagnostics"
|
|
"github.com/TNTcraftHIM/Piik/internal/media/forwarding"
|
|
"github.com/pion/ice/v4"
|
|
"github.com/pion/webrtc/v4"
|
|
)
|
|
|
|
const maxPendingCandidates = 64
|
|
|
|
type EdgeEvents struct {
|
|
LocalCandidate func(*webrtc.ICECandidateInit)
|
|
// Historical loss still retires input permission. Media projections must
|
|
// check isCurrentState again after any event queues.
|
|
ConnectionState func(state webrtc.PeerConnectionState, pair *SelectedPair, isCurrentState func(webrtc.PeerConnectionState) bool)
|
|
}
|
|
|
|
type EdgeOptions struct {
|
|
ConnectionID string
|
|
ICEServers []webrtc.ICEServer
|
|
Audio *AudioSource
|
|
Local bool
|
|
Punched bool
|
|
Events EdgeEvents
|
|
}
|
|
|
|
type Edge struct {
|
|
connectionID string
|
|
engine *Engine
|
|
socket *iceSocket
|
|
source *Source
|
|
audioSource *AudioSource
|
|
connection *webrtc.PeerConnection
|
|
sender *webrtc.RTPSender
|
|
audioSender *webrtc.RTPSender
|
|
targetBitrate func() (int, bool)
|
|
events EdgeEvents
|
|
transport *forwarding.Transport
|
|
local bool
|
|
|
|
mu sync.Mutex
|
|
pendingCandidates []webrtc.ICECandidateInit
|
|
remoteDescriptionSet bool
|
|
closed bool
|
|
qualityMu sync.Mutex
|
|
qualityBaseline qualityBaseline
|
|
answerMu sync.Mutex
|
|
localOfferID string
|
|
localCandidates *localCandidateGathering
|
|
}
|
|
|
|
func (engine *Engine) NewEdge(source *Source, options EdgeOptions) (_ *Edge, err error) {
|
|
if source == nil || source.engine != engine || options.ConnectionID == "" ||
|
|
len(options.ConnectionID) > 256 {
|
|
return nil, errors.New("native media edge input is invalid")
|
|
}
|
|
if options.Audio != nil && options.Audio.engine != engine {
|
|
return nil, errors.New("native audio edge source belongs to another engine")
|
|
}
|
|
if err := source.reserve(options.Local); err != nil {
|
|
return nil, err
|
|
}
|
|
if options.Audio != nil {
|
|
if err := options.Audio.reserve(options.Local); err != nil {
|
|
source.releaseReservation(options.Local)
|
|
return nil, err
|
|
}
|
|
}
|
|
var socket *iceSocket
|
|
if options.Punched && !options.Local {
|
|
connection := engine.TakePunchedSocket(options.ConnectionID, source)
|
|
if connection == nil {
|
|
err = errors.New("prepared connection is unavailable")
|
|
} else {
|
|
socket, err = engine.adoptICESocket(connection, options.ICEServers, true)
|
|
}
|
|
} else {
|
|
engine.ClosePunch(options.ConnectionID)
|
|
socket, err = engine.newICESocket(options.ICEServers, !options.Local)
|
|
}
|
|
if err != nil {
|
|
source.releaseReservation(options.Local)
|
|
if options.Audio != nil {
|
|
options.Audio.releaseReservation(options.Local)
|
|
}
|
|
return nil, err
|
|
}
|
|
defer func() {
|
|
if err != nil {
|
|
socket.close()
|
|
}
|
|
}()
|
|
var prepareMapping func() int
|
|
if socket.portMapping != nil {
|
|
prepareMapping = socket.portMapping.Prepare
|
|
}
|
|
var audio webrtc.TrackLocal
|
|
if options.Audio != nil {
|
|
audio = options.Audio.track
|
|
}
|
|
transport, err := forwarding.NewTransport(forwarding.TransportOptions{
|
|
Source: source.media.Source, Settings: socket.settings(), ConnectionID: options.ConnectionID,
|
|
InitialBitrate: engine.initialBitrate, Audio: audio,
|
|
})
|
|
if err != nil {
|
|
source.releaseReservation(options.Local)
|
|
if options.Audio != nil {
|
|
options.Audio.releaseReservation(options.Local)
|
|
}
|
|
return nil, err
|
|
}
|
|
connection := transport.PC
|
|
log := slog.Default().With("connectionId", diagnostics.ID(options.ConnectionID), "rtcPeerId", diagnostics.ID(connection.ID()))
|
|
edge := &Edge{
|
|
connectionID: options.ConnectionID,
|
|
engine: engine,
|
|
socket: socket,
|
|
source: source,
|
|
audioSource: options.Audio,
|
|
connection: connection,
|
|
transport: transport,
|
|
local: options.Local,
|
|
targetBitrate: transport.TargetBitrate,
|
|
events: options.Events,
|
|
sender: transport.VideoSender,
|
|
audioSender: transport.AudioSender,
|
|
}
|
|
if err = engine.register(edge); err != nil {
|
|
source.releaseReservation(options.Local)
|
|
if options.Audio != nil {
|
|
options.Audio.releaseReservation(options.Local)
|
|
}
|
|
_ = transport.Close()
|
|
return nil, err
|
|
}
|
|
if err = source.attach(edge, options.Local); err != nil {
|
|
if options.Audio != nil {
|
|
options.Audio.releaseReservation(options.Local)
|
|
}
|
|
engine.remove(edge)
|
|
_ = transport.Close()
|
|
return nil, err
|
|
}
|
|
if options.Audio != nil {
|
|
if err = options.Audio.attach(edge, options.Local); err != nil {
|
|
source.detach(edge)
|
|
engine.remove(edge)
|
|
_ = transport.Close()
|
|
return nil, err
|
|
}
|
|
}
|
|
if !options.Local {
|
|
parameters, parametersErr := connection.SCTP().Transport().ICETransport().GetLocalParameters()
|
|
if parametersErr != nil {
|
|
_ = edge.Close()
|
|
return nil, parametersErr
|
|
}
|
|
edge.localCandidates = newLocalCandidateGathering(
|
|
socket, options.ICEServers, prepareMapping, parameters.UsernameFragment, options.Events.LocalCandidate,
|
|
)
|
|
connection.OnICECandidate(func(candidate *webrtc.ICECandidate) {
|
|
edge.localCandidates.addPion(candidate)
|
|
})
|
|
}
|
|
connection.OnICEConnectionStateChange(func(state webrtc.ICEConnectionState) {
|
|
log.Debug("piik-client", "event", "media-ice-state", "direction", "outbound", "local", options.Local, "state", state.String())
|
|
})
|
|
if dtls := edge.sender.Transport(); dtls != nil {
|
|
dtls.OnStateChange(func(state webrtc.DTLSTransportState) {
|
|
log.Debug("piik-client", "event", "media-dtls-state", "direction", "outbound", "local", options.Local, "state", state.String())
|
|
})
|
|
}
|
|
connection.OnConnectionStateChange(func(state webrtc.PeerConnectionState) {
|
|
isCurrentState := func(expected webrtc.PeerConnectionState) bool { return connection.ConnectionState() == expected }
|
|
debug := slog.Default().Enabled(engine.ctx, slog.LevelDebug)
|
|
if debug {
|
|
log.Debug("piik-client", "event", "media-connection-state", "direction", "outbound", "local", options.Local, "state", state.String())
|
|
}
|
|
if state == webrtc.PeerConnectionStateConnected && isCurrentState(state) {
|
|
if err := edge.transport.SetConnected(); err != nil {
|
|
if debug {
|
|
log.Debug("piik-client", "event", "media-activation-failed", diagnostics.Error(err))
|
|
}
|
|
_ = connection.Close()
|
|
return
|
|
}
|
|
edge.source.RequestRecoveryFrame()
|
|
}
|
|
var selected *SelectedPair
|
|
if state == webrtc.PeerConnectionStateConnected && isCurrentState(state) && (edge.events.ConnectionState != nil || debug) {
|
|
if pair, pairErr := edge.SelectedPair(); pairErr == nil {
|
|
selected = &pair
|
|
if debug {
|
|
log.Debug("piik-client", "event", "media-selected-path", "direction", "outbound", "local", options.Local,
|
|
"localType", pair.Local.String(), "remoteType", pair.Remote.String(), "natTraversalPath", pair.NatTraversalPath)
|
|
}
|
|
}
|
|
}
|
|
if edge.events.ConnectionState != nil {
|
|
edge.events.ConnectionState(state, selected, isCurrentState)
|
|
}
|
|
})
|
|
return edge, nil
|
|
}
|
|
|
|
func (edge *Edge) ConnectionID() string {
|
|
return edge.connectionID
|
|
}
|
|
|
|
// SetTargetLayer is a media-component input, not a route change or UI setting.
|
|
func (edge *Edge) SetTargetLayer(layer int) error {
|
|
source := edge.source
|
|
changed := false
|
|
source.writeMu.Lock()
|
|
defer func() {
|
|
source.writeMu.Unlock()
|
|
if changed {
|
|
source.RequestRecoveryFrame()
|
|
}
|
|
}()
|
|
source.mu.Lock()
|
|
_, attached := source.edges[edge]
|
|
closed := source.closed
|
|
source.mu.Unlock()
|
|
if closed || !attached {
|
|
return io.ErrClosedPipe
|
|
}
|
|
if layer < 0 || layer >= len(source.formats) {
|
|
return errors.New("native output layer is invalid")
|
|
}
|
|
if len(source.outputBitrates) > 0 && source.outputBitrates[layer] == 0 {
|
|
return errors.New("native output layer is unavailable")
|
|
}
|
|
changed = edge.transport.Output.MaxLayer().Spatial != int32(layer)
|
|
edge.transport.Output.SetMaxSpatialLayer(int32(layer))
|
|
return nil
|
|
}
|
|
|
|
func (edge *Edge) CreateOffer() (webrtc.SessionDescription, error) {
|
|
if edge.local {
|
|
return webrtc.SessionDescription{}, errors.New("local media requires an identified offer")
|
|
}
|
|
offer, err := edge.connection.CreateOffer(nil)
|
|
if err != nil {
|
|
return webrtc.SessionDescription{}, err
|
|
}
|
|
if err = edge.connection.SetLocalDescription(offer); err != nil {
|
|
return webrtc.SessionDescription{}, err
|
|
}
|
|
edge.localCandidates.start()
|
|
return offer, nil
|
|
}
|
|
|
|
// OpenDataChannel adds an optional channel before the initial offer. The edge's
|
|
// PeerConnection owns its transport and closes it with the media connection.
|
|
func (edge *Edge) OpenDataChannel(label string) (*webrtc.DataChannel, error) {
|
|
return edge.connection.CreateDataChannel(label, nil)
|
|
}
|
|
|
|
// Local bridges have no STUN or gateway discovery. Complete SDP keeps their
|
|
// candidates and answer in one bounded negotiation, including ICE restarts.
|
|
func (edge *Edge) CreateLocalOffer(ctx context.Context, offerID string, restart bool) (webrtc.SessionDescription, error) {
|
|
edge.answerMu.Lock()
|
|
defer edge.answerMu.Unlock()
|
|
edge.mu.Lock()
|
|
available := edge.local && !edge.closed && offerID != "" && offerID != edge.localOfferID &&
|
|
((!restart && edge.localOfferID == "") || (restart && edge.remoteDescriptionSet))
|
|
edge.mu.Unlock()
|
|
if !available {
|
|
return webrtc.SessionDescription{}, errors.New("local media negotiation is unavailable")
|
|
}
|
|
ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
|
|
defer cancel()
|
|
if err := ctx.Err(); err != nil {
|
|
return webrtc.SessionDescription{}, err
|
|
}
|
|
offer, err := edge.connection.CreateOffer(&webrtc.OfferOptions{ICERestart: restart})
|
|
if err != nil {
|
|
return webrtc.SessionDescription{}, err
|
|
}
|
|
gathered := webrtc.GatheringCompletePromise(edge.connection)
|
|
if err = edge.connection.SetLocalDescription(offer); err != nil {
|
|
return webrtc.SessionDescription{}, err
|
|
}
|
|
edge.localOfferID = offerID
|
|
edge.mu.Lock()
|
|
edge.remoteDescriptionSet = false
|
|
edge.mu.Unlock()
|
|
select {
|
|
case <-gathered:
|
|
if description := edge.connection.LocalDescription(); description != nil {
|
|
return *description, nil
|
|
}
|
|
return webrtc.SessionDescription{}, io.ErrClosedPipe
|
|
case <-ctx.Done():
|
|
return webrtc.SessionDescription{}, ctx.Err()
|
|
case <-edge.socket.ctx.Done():
|
|
return webrtc.SessionDescription{}, io.ErrClosedPipe
|
|
}
|
|
}
|
|
|
|
func (edge *Edge) SetAnswer(answer webrtc.SessionDescription, offerID string) error {
|
|
edge.answerMu.Lock()
|
|
defer edge.answerMu.Unlock()
|
|
if (edge.local && (offerID == "" || offerID != edge.localOfferID)) || (!edge.local && offerID != "") {
|
|
return errors.New("native media answer does not match its offer")
|
|
}
|
|
if answer.Type != webrtc.SDPTypeAnswer {
|
|
return errors.New("native media edge requires an SDP answer")
|
|
}
|
|
edge.mu.Lock()
|
|
if edge.closed {
|
|
edge.mu.Unlock()
|
|
return errors.New("native media edge is closed")
|
|
}
|
|
if edge.remoteDescriptionSet {
|
|
// A repeated answer within the same connection/offer is a
|
|
// retransmission; its first applied description remains authoritative.
|
|
edge.mu.Unlock()
|
|
return nil
|
|
}
|
|
edge.mu.Unlock()
|
|
if edge.audioSource != nil {
|
|
if err := forwarding.CheckAudioReceiveLimit(answer.SDP, nativeaudio.MaxBitrate); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
if err := edge.connection.SetRemoteDescription(answer); err != nil {
|
|
return err
|
|
}
|
|
if err := edge.socket.addPunchedPeer(edge.connection); err != nil {
|
|
return err
|
|
}
|
|
edge.mu.Lock()
|
|
edge.remoteDescriptionSet = true
|
|
pending := edge.pendingCandidates
|
|
edge.pendingCandidates = nil
|
|
edge.mu.Unlock()
|
|
for _, candidate := range pending {
|
|
// Candidates are disposable edge input. The connection state callback
|
|
// remains the authority for a real media failure.
|
|
if err := forwarding.AddICECandidate(edge.connection, candidate); err != nil {
|
|
slog.Debug("media-candidate-rejected", "connectionId", diagnostics.ID(edge.connectionID), "stage", "drain", diagnostics.Error(err))
|
|
}
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (edge *Edge) AddRemoteCandidate(candidate *webrtc.ICECandidateInit) error {
|
|
if edge.local {
|
|
return errors.New("local media candidates belong in the SDP answer")
|
|
}
|
|
if malformedRemoteCandidate(candidate) {
|
|
slog.Debug("media-candidate-rejected", "connectionId", diagnostics.ID(edge.connectionID), "stage", "malformed")
|
|
return nil
|
|
}
|
|
value := webrtc.ICECandidateInit{}
|
|
if candidate != nil {
|
|
value = *candidate
|
|
}
|
|
edge.mu.Lock()
|
|
if edge.closed {
|
|
edge.mu.Unlock()
|
|
return nil
|
|
}
|
|
if !edge.remoteDescriptionSet {
|
|
if len(edge.pendingCandidates) >= maxPendingCandidates {
|
|
edge.mu.Unlock()
|
|
slog.Debug("media-candidate-rejected", "connectionId", diagnostics.ID(edge.connectionID), "stage", "queue-full", "capacity", maxPendingCandidates)
|
|
return nil
|
|
}
|
|
edge.pendingCandidates = append(edge.pendingCandidates, value)
|
|
edge.mu.Unlock()
|
|
return nil
|
|
}
|
|
edge.mu.Unlock()
|
|
// A candidate may become stale between validation and delivery. Dropping
|
|
// that one edge input keeps the shared control session alive; ICE state
|
|
// events still report whether the edge itself can connect.
|
|
if err := forwarding.AddICECandidate(edge.connection, value); err != nil {
|
|
slog.Debug("media-candidate-rejected", "connectionId", diagnostics.ID(edge.connectionID), "stage", "apply", diagnostics.Error(err))
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func malformedRemoteCandidate(candidate *webrtc.ICECandidateInit) bool {
|
|
if candidate == nil || candidate.Candidate == "" {
|
|
return false
|
|
}
|
|
_, err := ice.UnmarshalCandidate(strings.TrimPrefix(candidate.Candidate, "candidate:"))
|
|
return err != nil
|
|
}
|
|
|
|
type SelectedPair struct {
|
|
Local webrtc.ICECandidateType
|
|
Remote webrtc.ICECandidateType
|
|
NatTraversalPath string
|
|
}
|
|
|
|
func (edge *Edge) SelectedPair() (SelectedPair, error) {
|
|
transport := edge.sender.Transport()
|
|
if transport == nil || transport.ICETransport() == nil {
|
|
return SelectedPair{}, errors.New("native media ICE transport is unavailable")
|
|
}
|
|
pair, err := transport.ICETransport().GetSelectedCandidatePair()
|
|
if err != nil || pair == nil {
|
|
return SelectedPair{}, errors.New("native media ICE pair is unavailable")
|
|
}
|
|
return SelectedPair{
|
|
Local: pair.Local.Typ, Remote: pair.Remote.Typ,
|
|
NatTraversalPath: selectedNatTraversalPath(
|
|
pair.Local.Foundation,
|
|
pair.Remote.Foundation,
|
|
),
|
|
}, nil
|
|
}
|
|
|
|
func selectedNatTraversalPath(foundations ...string) string {
|
|
for _, foundation := range foundations {
|
|
if len(foundation) < 3 || foundation[0] != 's' ||
|
|
(foundation[1] != 'p' && foundation[1] != 'm') {
|
|
continue
|
|
}
|
|
if _, err := strconv.Atoi(foundation[2:]); err == nil {
|
|
return "predicted"
|
|
}
|
|
}
|
|
for _, foundation := range foundations {
|
|
if foundation != "" {
|
|
return "ordinary"
|
|
}
|
|
}
|
|
return "unknown"
|
|
}
|
|
|
|
func (edge *Edge) State() webrtc.PeerConnectionState {
|
|
return edge.connection.ConnectionState()
|
|
}
|
|
|
|
func (edge *Edge) Close() error {
|
|
edge.mu.Lock()
|
|
if edge.closed {
|
|
edge.mu.Unlock()
|
|
return nil
|
|
}
|
|
edge.closed = true
|
|
if edge.localCandidates != nil {
|
|
edge.localCandidates.close()
|
|
}
|
|
edge.pendingCandidates = nil
|
|
edge.mu.Unlock()
|
|
if edge.local && slog.Default().Enabled(edge.engine.ctx, slog.LevelDebug) {
|
|
logLocalMediaCandidateCounts(slog.Default(), edge.connection.GetStats())
|
|
}
|
|
err := edge.transport.Close()
|
|
edge.socket.close()
|
|
edge.source.detach(edge)
|
|
if edge.audioSource != nil {
|
|
edge.audioSource.detach(edge)
|
|
}
|
|
edge.engine.remove(edge)
|
|
return err
|
|
}
|
|
|
|
func logLocalMediaCandidateCounts(logger *slog.Logger, report webrtc.StatsReport) {
|
|
for _, direction := range []webrtc.StatsType{webrtc.StatsTypeLocalCandidate, webrtc.StatsTypeRemoteCandidate} {
|
|
for _, kind := range []webrtc.ICECandidateType{webrtc.ICECandidateTypeHost, webrtc.ICECandidateTypeSrflx, webrtc.ICECandidateTypePrflx, webrtc.ICECandidateTypeRelay} {
|
|
udp, tcp := 0, 0
|
|
for _, entry := range report {
|
|
candidate, ok := entry.(webrtc.ICECandidateStats)
|
|
if !ok || candidate.Type != direction || candidate.CandidateType != kind || candidate.Deleted {
|
|
continue
|
|
}
|
|
switch candidate.Protocol {
|
|
case "udp":
|
|
udp++
|
|
case "tcp":
|
|
tcp++
|
|
}
|
|
}
|
|
logger.Debug("piik-client", "event", "media-candidate-counts", "local", true,
|
|
"direction", string(direction), "type", kind.String(), "udp", udp, "tcp", tcp)
|
|
}
|
|
}
|
|
}
|
|
|
|
// Shutdown must release every transport before waiting on shared source writes.
|
|
func closeEdges(edges []*Edge) {
|
|
for _, edge := range edges {
|
|
_ = edge.connection.Close()
|
|
}
|
|
for _, edge := range edges {
|
|
_ = edge.Close()
|
|
}
|
|
}
|