mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-05-14 00:51:12 +03:00
19 lines
311 B
Go
19 lines
311 B
Go
//go:build !(linux || darwin || windows)
|
|
|
|
package tf
|
|
|
|
import (
|
|
"context"
|
|
"net"
|
|
"time"
|
|
)
|
|
|
|
func writeAndWaitAck(ctx context.Context, conn *net.TCPConn, payload []byte, fallbackDelay time.Duration) error {
|
|
_, err := conn.Write(payload)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
time.Sleep(fallbackDelay)
|
|
return nil
|
|
}
|