From e35dbc4cce88d32f3beb410b7b8250b9f9a3e796 Mon Sep 17 00:00:00 2001 From: crusader Date: Wed, 1 Nov 2017 15:21:49 +0900 Subject: [PATCH] ing --- server/server.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/server/server.go b/server/server.go index 0db7018..78206b4 100644 --- a/server/server.go +++ b/server/server.go @@ -4,11 +4,10 @@ import ( "log" "net" - "git.loafle.net/commons_go/rpc/protocol" "git.loafle.net/commons_go/server" ) -func New(sh ServerHandler) Server { +func New(sh ServerHandler) server.Server { lsh := &serverHandlers{} lsh.ServerHandler = sh lsh.lsh = sh @@ -31,14 +30,15 @@ func (sh *serverHandlers) Handle(conn net.Conn, stopChan <-chan struct{}, doneCh return } - var codecReq protocol.ServerCodecRequest - -Loop: for { sh.lsh.OnPreRead(conn) // Create a new codec request. codecReq, errNew := codec.NewRequest(conn) if nil != errNew { + if sh.IsClientDisconnect(errNew) { + doneChan <- struct{}{} + return + } log.Printf("RPC Handle: %v", errNew) doneChan <- struct{}{} return