mirror of
https://github.com/schollz/croc.git
synced 2024-11-24 16:23:47 +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 {
|
||||
return
|
||||
}
|
||||
defer connection.Close()
|
||||
connection.SetReadDeadline(time.Now().Add(3 * time.Hour))
|
||||
connection.SetDeadline(time.Now().Add(3 * time.Hour))
|
||||
connection.SetWriteDeadline(time.Now().Add(3 * time.Hour))
|
||||
|
@ -306,10 +306,11 @@ func connectToTCPServer(room string, address string) (com comm.Comm, err error)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
defer connection.Close()
|
||||
connection.SetReadDeadline(time.Now().Add(3 * time.Hour))
|
||||
connection.SetDeadline(time.Now().Add(3 * time.Hour))
|
||||
connection.SetWriteDeadline(time.Now().Add(3 * time.Hour))
|
||||
|
||||
|
||||
com = comm.New(connection)
|
||||
ok, err := com.Receive()
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user