This commit is contained in:
zhouyuyan
2017-08-22 16:54:39 +08:00
parent b2f5174fc5
commit 38ec192621
2 changed files with 24 additions and 1 deletions

View File

@@ -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
View 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() {
}