Skip to content

Commit 0f70e53

Browse files
Merge pull request #19 from riklus/master
Handling connection error #18
2 parents 1c4e243 + ed547f8 commit 0f70e53

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

main.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,11 @@ func main() {
250250

251251
mutex = &sync.Mutex{}
252252
for {
253-
conn, _ := l.Accept()
254-
go handle_connection(conn, *tunnel)
253+
conn, err := l.Accept()
254+
if err != nil {
255+
log.Println("[WARN] Could not accept connection")
256+
} else {
257+
go handle_connection(conn, *tunnel)
258+
}
255259
}
256260
}

0 commit comments

Comments
 (0)