mirror of
https://github.com/fhmq/hmq.git
synced 2026-04-24 10:38:34 +00:00
packet
This commit is contained in:
@@ -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]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user