mirror of
https://github.com/schollz/croc.git
synced 2024-11-28 09:35:14 +03:00
make sure to close connection
This commit is contained in:
parent
f56d5c797c
commit
7df06272b8
@ -329,6 +329,7 @@ func connectToTCPServer(room string, address string) (com comm.Comm, err error)
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
defer connection.Close()
|
||||||
connection.SetReadDeadline(time.Now().Add(3 * time.Hour))
|
connection.SetReadDeadline(time.Now().Add(3 * time.Hour))
|
||||||
connection.SetDeadline(time.Now().Add(3 * time.Hour))
|
connection.SetDeadline(time.Now().Add(3 * time.Hour))
|
||||||
connection.SetWriteDeadline(time.Now().Add(3 * time.Hour))
|
connection.SetWriteDeadline(time.Now().Add(3 * time.Hour))
|
||||||
|
@ -306,6 +306,7 @@ func connectToTCPServer(room string, address string) (com comm.Comm, err error)
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
defer connection.Close()
|
||||||
connection.SetReadDeadline(time.Now().Add(3 * time.Hour))
|
connection.SetReadDeadline(time.Now().Add(3 * time.Hour))
|
||||||
connection.SetDeadline(time.Now().Add(3 * time.Hour))
|
connection.SetDeadline(time.Now().Add(3 * time.Hour))
|
||||||
connection.SetWriteDeadline(time.Now().Add(3 * time.Hour))
|
connection.SetWriteDeadline(time.Now().Add(3 * time.Hour))
|
||||||
|
Loading…
Reference in New Issue
Block a user