packet
This commit is contained in:
1 parent
38ec192621
commit
fe936d0e37
1 file changed
+16
-3
+16
-3
@@ -1,15 +1,28 @@
|
|||||||
package broker
|
package broker
|
||||||
|
|
||||||
import "net"
|
import (
|
||||||
|
"fhmq/lib/message"
|
||||||
|
"net"
|
||||||
|
"strings"
|
||||||
|
)
|
||||||
|
|
||||||
type client struct {
|
type client struct {
|
||||||
broker Broker
|
broker Broker
|
||||||
conn net.Conn
|
conn net.Conn
|
||||||
|
info info
|
||||||
|
localIP string
|
||||||
|
remoteIP string
|
||||||
|
}
|
||||||
|
|
||||||
|
type info struct {
|
||||||
clientID []byte
|
clientID []byte
|
||||||
username []byte
|
username []byte
|
||||||
password []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]
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user