Files

27 lines
483 B
Go
Raw Permalink Normal View History

2023-03-03 19:26:54 +08:00
package libbox
import (
"encoding/binary"
"net"
runtimeDebug "runtime/debug"
"time"
)
2023-07-02 16:45:30 +08:00
func (c *CommandClient) CloseConnections() error {
conn, err := c.directConnect()
2023-03-03 19:26:54 +08:00
if err != nil {
return err
}
defer conn.Close()
return binary.Write(conn, binary.BigEndian, uint8(CommandCloseConnections))
}
func (s *CommandServer) handleCloseConnections(conn net.Conn) error {
2025-01-03 18:34:07 +08:00
tracker.Close()
2023-03-03 19:26:54 +08:00
go func() {
time.Sleep(time.Second)
runtimeDebug.FreeOSMemory()
}()
return nil
}