2022-10-11 17:36:09 +08:00
|
|
|
package network
|
|
|
|
|
|
|
|
import (
|
|
|
|
"math/rand"
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
2023-04-05 16:15:59 +08:00
|
|
|
// ConnState represents the state of the connection.
|
|
|
|
type ConnState = string
|
2022-10-11 17:36:09 +08:00
|
|
|
|
|
|
|
// ConnState represents the state of a connection.
|
|
|
|
const (
|
2023-04-05 16:15:59 +08:00
|
|
|
ConnStateReady ConnState = "Ready"
|
|
|
|
ConnStateDisconnected ConnState = "Disconnected"
|
|
|
|
ConnStateConnecting ConnState = "Connecting"
|
|
|
|
ConnStateConnected ConnState = "Connected"
|
|
|
|
ConnStateClosed ConnState = "Closed"
|
2022-10-11 17:36:09 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
rand.Seed(time.Now().Unix())
|
|
|
|
}
|