Source file src/net/tcpconn_keepalive_conf_posix_test.go

     1  // Copyright 2024 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  //go:build aix || darwin || dragonfly || freebsd || illumos || linux || netbsd || windows
     6  
     7  package net
     8  
     9  import "time"
    10  
    11  var testConfigs = []KeepAliveConfig{
    12  	{
    13  		Enable:   true,
    14  		Idle:     5 * time.Second,
    15  		Interval: 3 * time.Second,
    16  		Count:    10,
    17  	},
    18  	{
    19  		Enable:   true,
    20  		Idle:     0,
    21  		Interval: 0,
    22  		Count:    0,
    23  	},
    24  	{
    25  		Enable:   true,
    26  		Idle:     -1,
    27  		Interval: -1,
    28  		Count:    -1,
    29  	},
    30  	{
    31  		Enable:   true,
    32  		Idle:     -1,
    33  		Interval: 3 * time.Second,
    34  		Count:    10,
    35  	},
    36  	{
    37  		Enable:   true,
    38  		Idle:     5 * time.Second,
    39  		Interval: -1,
    40  		Count:    10,
    41  	},
    42  	{
    43  		Enable:   true,
    44  		Idle:     5 * time.Second,
    45  		Interval: 3 * time.Second,
    46  		Count:    -1,
    47  	},
    48  	{
    49  		Enable:   true,
    50  		Idle:     -1,
    51  		Interval: -1,
    52  		Count:    10,
    53  	},
    54  	{
    55  		Enable:   true,
    56  		Idle:     -1,
    57  		Interval: 3 * time.Second,
    58  		Count:    -1,
    59  	},
    60  	{
    61  		Enable:   true,
    62  		Idle:     5 * time.Second,
    63  		Interval: -1,
    64  		Count:    -1,
    65  	},
    66  	{
    67  		Enable:   true,
    68  		Idle:     0,
    69  		Interval: 3 * time.Second,
    70  		Count:    10,
    71  	},
    72  	{
    73  		Enable:   true,
    74  		Idle:     5 * time.Second,
    75  		Interval: 0,
    76  		Count:    10,
    77  	},
    78  	{
    79  		Enable:   true,
    80  		Idle:     5 * time.Second,
    81  		Interval: 3 * time.Second,
    82  		Count:    0,
    83  	},
    84  	{
    85  		Enable:   true,
    86  		Idle:     0,
    87  		Interval: 0,
    88  		Count:    10,
    89  	},
    90  	{
    91  		Enable:   true,
    92  		Idle:     0,
    93  		Interval: 3 * time.Second,
    94  		Count:    0,
    95  	},
    96  	{
    97  		Enable:   true,
    98  		Idle:     5 * time.Second,
    99  		Interval: 0,
   100  		Count:    0,
   101  	},
   102  }
   103  

View as plain text