This commit is contained in:
crusader 2017-11-28 18:41:00 +09:00
parent 28723e5290
commit dd65016b7d
3 changed files with 3 additions and 3 deletions

View File

@ -176,7 +176,7 @@ func handleConnection(s *server, soc Socket, socketHandler SocketHandler) {
defer s.stopWg.Done()
clientStopChan := make(chan struct{})
handleDoneChan := make(chan struct{})
handleDoneChan := make(chan error, 1)
go socketHandler.Handle(soc, clientStopChan, handleDoneChan)

View File

@ -32,7 +32,7 @@ type SocketHandler interface {
// return newSoc
// }
OnConnect(soc Socket)
Handle(soc Socket, stopChan <-chan struct{}, doneChan chan<- struct{})
Handle(soc Socket, stopChan <-chan struct{}, doneChan chan<- error)
// OnDisconnect invoked when client is disconnected
// If you override ths method, must call
//

View File

@ -48,7 +48,7 @@ func (sh *SocketHandlers) OnConnect(soc Socket) Socket {
return soc
}
func (sh *SocketHandlers) Handle(soc Socket, stopChan <-chan struct{}, doneChan chan<- struct{}) {
func (sh *SocketHandlers) Handle(soc Socket, stopChan <-chan struct{}, doneChan chan<- error) {
// no op
}