Skip to content

Commit

Permalink
Print error message if no connection
Browse files Browse the repository at this point in the history
  • Loading branch information
quackduck committed Feb 13, 2021
1 parent ca48e3c commit 7eaa68a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
.vscode
__debug_bin
/uniclip
.idea
.idea
/dist
5 changes: 5 additions & 0 deletions uniclip.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ func handleClient(c net.Conn) {

func connectToServer(address string) {
c, err := net.Dial("tcp4", address)
if c == nil {
handleError(err)
fmt.Println("Could not connect to", address)
return
}
if err != nil {
handleError(err)
return
Expand Down

0 comments on commit 7eaa68a

Please sign in to comment.