mirror of
https://github.com/fhmq/hmq.git
synced 2026-04-24 10:38:34 +00:00
packet
This commit is contained in:
@@ -44,10 +44,18 @@ func (b *Broker) StartListening() {
|
||||
func handleConnection(conn net.Conn) {
|
||||
|
||||
//process connect packet
|
||||
connMsg, err := ReadPacket(conn)
|
||||
buf, err := ReadPacket(conn)
|
||||
if err != nil {
|
||||
log.Error("read connect packet error: ", err)
|
||||
return
|
||||
}
|
||||
connMsg, err := DecodeConnectMessage(buf)
|
||||
if err != nil {
|
||||
log.Error(err)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
func (b *Broker) NewClient() {
|
||||
|
||||
}
|
||||
|
||||
15
broker/client.go
Normal file
15
broker/client.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package broker
|
||||
|
||||
import "net"
|
||||
|
||||
type client struct {
|
||||
broker Broker
|
||||
conn net.Conn
|
||||
clientID []byte
|
||||
username []byte
|
||||
password []byte
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user