Skip to content
This repository has been archived by the owner on May 26, 2022. It is now read-only.

Commit

Permalink
Merge pull request #175 from libp2p/cmd-client-close-conn
Browse files Browse the repository at this point in the history
always close the connection in the cmd client
  • Loading branch information
Stebalien authored Oct 26, 2020
2 parents c7206b9 + 311d801 commit e97576b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ func run(raddr string, p string) error {
if err != nil {
return err
}
defer conn.Close()
str, err := conn.OpenStream()
if err != nil {
return err
Expand All @@ -65,5 +66,5 @@ func run(raddr string, p string) error {
return err
}
log.Printf("Received: %s\n", data)
return conn.Close()
return nil
}

0 comments on commit e97576b

Please sign in to comment.