|
|
@@ -12,17 +12,13 @@ type WsClient struct {
|
|
|
pos int //
|
|
|
}
|
|
|
|
|
|
-func NewWsClient(cf *nnet.HubConfig, cb nnet.ISessionCallback, p nnet.IProtocol) *WsClient {
|
|
|
+func NewWsClient(cf *nnet.HubConfig, cb nnet.ISessionCallback, p nnet.IProtocol) nnet.IHub {
|
|
|
return &WsClient{
|
|
|
Hub: newHub(cf, cb, p),
|
|
|
pos: 0,
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-func (self *WsClient) Start() error {
|
|
|
- return nil
|
|
|
-}
|
|
|
-
|
|
|
func (self *WsClient) NewConnection(addr string, id uint64) error {
|
|
|
conn, _, err := websocket.DefaultDialer.Dial(addr, nil)
|
|
|
if err != nil {
|
|
|
@@ -38,13 +34,3 @@ func (self *WsClient) NewConnection(addr string, id uint64) error {
|
|
|
|
|
|
return nil
|
|
|
}
|
|
|
-
|
|
|
-func (self *WsClient) DoJob(int) {
|
|
|
-
|
|
|
-}
|
|
|
-
|
|
|
-func (self *WsClient) Stop() error {
|
|
|
- close(self.chQuit)
|
|
|
- self.wg.Wait()
|
|
|
- return nil
|
|
|
-}
|