Skip to content

Commit

Permalink
fixed client close panic
Browse files Browse the repository at this point in the history
  • Loading branch information
cnlh committed Nov 2, 2024
1 parent 4230056 commit 9098500
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,12 @@ func (c *Client) Write(b []byte) (int, error) {
}

func (c *Client) Close() error {
if c.UDPConn == nil {
return c.TCPConn.Close()
}
if c.TCPConn != nil {
c.TCPConn.Close()
}
if c.UDPConn == nil {
return nil
}
return c.UDPConn.Close()
}

Expand Down

0 comments on commit 9098500

Please sign in to comment.