Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for TestCheckPortAvailability (0.26 sec)

  1. internal/http/check_port_test.go

    package http
    
    import (
    	"fmt"
    	"net"
    	"runtime"
    	"strconv"
    	"testing"
    )
    
    // Tests for port availability logic written for server startup sequence.
    func TestCheckPortAvailability(t *testing.T) {
    	if runtime.GOOS != "linux" {
    		t.Skip()
    	}
    
    	l, err := net.Listen("tcp", "localhost:0") // ask kernel for a free port.
    	if err != nil {
    		t.Fatal(err)
    	}
    	defer l.Close()
    
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Wed May 03 21:12:25 GMT 2023
    - 1.9K bytes
    - Viewed (0)
Back to top