This commit is contained in:
zhouyuyan
2017-08-22 16:58:50 +08:00
parent 38ec192621
commit fe936d0e37

View File

@@ -1,15 +1,28 @@
package broker
import "net"
import (
"fhmq/lib/message"
"net"
"strings"
)
type client struct {
broker Broker
conn net.Conn
info info
localIP string
remoteIP string
}
type info struct {
clientID []byte
username []byte
password []byte
keeplive uint16
willMsg *message.PublishMessage
}
func init() {
func (c *client) init() {
c.localIP = strings.Split(c.conn.LocalAddr().String(), ":")[0]
c.remoteIP = strings.Split(c.conn.RemoteAddr().String(), ":")[0]
}