mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-12-02 12:04:23 +00:00
22 lines
409 B
Go
22 lines
409 B
Go
package main
|
|
|
|
import (
|
|
"log"
|
|
"net"
|
|
)
|
|
|
|
// RawTCPDiagnosticListener is a diagnostic server listening on a TCP port
|
|
type RawTCPDiagnosticListener struct{}
|
|
|
|
// Listen for RawTCPDiagnosticListener listens on port 62374
|
|
func (l RawTCPDiagnosticListener) Listen() {
|
|
ip, err := net.Listen("tcp", ":62374")
|
|
if err != nil {
|
|
log.Printf("Failed to bind to TCP port 62374: %s", err)
|
|
}
|
|
|
|
for {
|
|
TarRespond(ip)
|
|
}
|
|
}
|