You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
696 B
29 lines
696 B
package network |
|
|
|
import ( |
|
"math/rand" |
|
"time" |
|
) |
|
|
|
// ConnState represents the state of the connection. |
|
type ConnState = string |
|
|
|
// ConnState represents the state of a connection. |
|
const ( |
|
ConnStateReady ConnState = "Ready" |
|
ConnStateDisconnected ConnState = "Disconnected" |
|
ConnStateConnecting ConnState = "Connecting" |
|
ConnStateConnected ConnState = "Connected" |
|
ConnStateClosed ConnState = "Closed" |
|
) |
|
|
|
// Prefix is the prefix for logger. |
|
const ( |
|
ClientLogPrefix = "\033[36m[network:client]\033[0m " |
|
ServerLogPrefix = "\033[32m[network:server]\033[0m " |
|
ParseFrameLogPrefix = "\033[36m[network:stream_parser]\033[0m " |
|
) |
|
|
|
func init() { |
|
rand.Seed(time.Now().Unix()) |
|
}
|
|
|