@@ -20,15 +20,14 @@ var ErrTestFailed = errors.New("test failed")
2020
2121// ConnTester performs connections against a certain destination
2222type ConnTester struct {
23- protocol string
24- targetHost string
25- targetPort uint16
26- message string
27- timeout uint
28- readTimeout uint
29- attempts uint
30- period uint
31- succThrPec uint
23+ protocol string
24+ targetHost string
25+ targetPort uint16
26+ message string
27+ timeout uint
28+ attempts uint
29+ period uint
30+ succThrPec uint
3231
3332 logger * log.Logger
3433
@@ -46,15 +45,14 @@ func New(config *config.Config, logger *log.Logger) (*ConnTester, error) {
4645 }
4746
4847 ct := & ConnTester {
49- protocol : config .Protocol ,
50- targetHost : config .TargetHost ,
51- targetPort : config .TargetPort ,
52- message : config .Message ,
53- timeout : config .Timeout ,
54- readTimeout : config .ReadTimeout ,
55- attempts : config .Attempts ,
56- period : config .Period ,
57- succThrPec : config .SuccThrPec ,
48+ protocol : config .Protocol ,
49+ targetHost : config .TargetHost ,
50+ targetPort : config .TargetPort ,
51+ message : config .Message ,
52+ timeout : config .Timeout ,
53+ attempts : config .Attempts ,
54+ period : config .Period ,
55+ succThrPec : config .SuccThrPec ,
5856 }
5957 ct .logger = logger
6058 return ct , nil
@@ -143,7 +141,6 @@ func (c *ConnTester) send(ctx context.Context, wg *sync.WaitGroup) {
143141 c .logger .Info ("TCP FIN packet sent, writing side closed" )
144142 }
145143
146- conn .SetReadDeadline (time .Now ().Add (time .Duration (c .readTimeout ) * time .Millisecond ))
147144 _ , err = io .Copy (io .Discard , conn )
148145 if err != nil && err != io .EOF {
149146 c .logger .Info (fmt .Sprintf ("stopped discarding data from %s: %s" , dstEndpoint , err ))
0 commit comments