This commit is contained in:
crusader
2018-07-01 13:09:50 +09:00
parent e3d3ae3288
commit 37e3381997
11 changed files with 55 additions and 61 deletions

View File

@@ -110,12 +110,12 @@ func (s *ContainerService) Send(containerType occp.ContainerType, method string,
}
containerSession := _containerSession.(*container.ContainerSession)
buff, err := s.RPCServerCodec.NewNotification(method, params)
messageType, message, err := s.RPCServerCodec.NewNotification(method, params)
if nil != err {
return err
}
return containerSession.Send(buff)
return containerSession.Send(messageType, message)
}
func (s *ContainerService) RunContainer(containerType occp.ContainerType) error {

View File

@@ -8,7 +8,8 @@ import (
cda "git.loafle.net/commons/di-go/annotation"
cdr "git.loafle.net/commons/di-go/registry"
logging "git.loafle.net/commons/logging-go"
csc "git.loafle.net/commons/server-go/client"
css "git.loafle.net/commons/server-go/socket"
cssc "git.loafle.net/commons/server-go/socket/client"
ocmd "git.loafle.net/overflow/commons-go/model/data"
ocsp "git.loafle.net/overflow/commons-go/service/probe"
"git.loafle.net/overflow/probe/client/data"
@@ -28,9 +29,9 @@ type MetricService struct {
cda.TypeAnnotation `annotation:"@overflow:RPCService()"`
connector csc.Connector
readChan <-chan []byte
writeChan chan<- []byte
connector cssc.Connector
readChan <-chan css.SocketMessage
writeChan chan<- css.SocketMessage
}
func (s *MetricService) InitService() error {
@@ -77,7 +78,7 @@ func (s *MetricService) Send(metric *ocmd.Metric) error {
}
// s.MetricService.Send("MS", sensorConfigID, metric)
// logging.Logger().Debugf("Metric: %v", metric)
s.writeChan <- buff
s.writeChan <- css.MakeSocketMessage(css.TextMessage, buff)
return nil
}