|
|
@@ -278,7 +278,7 @@ func (h *Hub) sendRequest(gd *GetData) (count int, err error) {
|
|
|
go h.outResponse(&ResponseData{
|
|
|
Id: id,
|
|
|
State: config.GET_TIMEOUT,
|
|
|
- Data: fmt.Appendf(nil, "[%s] %s %s", IdMsg(config.GET_TIMEOUT), conn.channel, gd.Cmd),
|
|
|
+ Data: fmt.Appendf(nil, "[%s] %s %s", StateIdString(config.GET_TIMEOUT), conn.channel, gd.Cmd),
|
|
|
conn: conn,
|
|
|
})
|
|
|
// 检查是否已经很久时间没有使用连接了
|
|
|
@@ -331,7 +331,7 @@ func (h *Hub) sendRequest(gd *GetData) (count int, err error) {
|
|
|
if i == 0 && h.connectHostFunc != nil && h.filterToChannelFunc != nil {
|
|
|
channel := h.filterToChannelFunc(gd.Filter)
|
|
|
if channel == "" {
|
|
|
- err = errors.New(IdMsg(NO_MATCH_CONNECT))
|
|
|
+ err = errors.New(StateIdString(NO_MATCH_CONNECT))
|
|
|
log.Println("not channel found with cmd:", gd.Cmd)
|
|
|
return 0, err
|
|
|
}
|
|
|
@@ -398,7 +398,7 @@ func (h *Hub) requestFromNet(request *RequestData) {
|
|
|
if err != nil {
|
|
|
log.Println(err.Error())
|
|
|
state = config.CONVERT_FAILED
|
|
|
- byteData = fmt.Appendf(nil, "[%s] %s %s", IdMsg(config.CONVERT_FAILED), request.conn.channel, request.Cmd)
|
|
|
+ byteData = fmt.Appendf(nil, "[%s] %s %s", StateIdString(config.CONVERT_FAILED), request.conn.channel, request.Cmd)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -423,7 +423,7 @@ func (h *Hub) requestFromNet(request *RequestData) {
|
|
|
request.conn.sendResponse <- &ResponseData{
|
|
|
Id: request.Id,
|
|
|
State: config.NO_MATCH_CMD,
|
|
|
- Data: fmt.Appendf(nil, "[%s] Channel: %s, Cmd: %s", IdMsg(config.NO_MATCH_CMD), channel, cmd),
|
|
|
+ Data: fmt.Appendf(nil, "[%s] Channel: %s, Cmd: %s", StateIdString(config.NO_MATCH_CMD), channel, cmd),
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -502,7 +502,7 @@ func (h *Hub) GetOneWithStruct(gd *GetData) (response *ResponseData) {
|
|
|
if gd.Filter == nil {
|
|
|
return &ResponseData{
|
|
|
State: config.NO_MATCH_FILTER,
|
|
|
- Data: []byte(IdMsg(config.NO_MATCH_FILTER)),
|
|
|
+ Data: []byte(StateIdString(config.NO_MATCH_FILTER)),
|
|
|
}
|
|
|
}
|
|
|
gd.Max = 1
|
|
|
@@ -513,7 +513,7 @@ func (h *Hub) GetOneWithStruct(gd *GetData) (response *ResponseData) {
|
|
|
if response == nil {
|
|
|
return &ResponseData{
|
|
|
State: config.NO_MATCH_CONNECT,
|
|
|
- Data: []byte(IdMsg(config.NO_MATCH_CONNECT)),
|
|
|
+ Data: []byte(StateIdString(config.NO_MATCH_CONNECT)),
|
|
|
}
|
|
|
}
|
|
|
return
|