예제 #1
0
func (tcpClient *TcpClient) Close() {

	tcpClient.eventDispatch.Close()
	elog.LogSys(" close  conn  ")
	tcpClient.conn.Close()
	tcpClient.waitGroup.Wait()
	//关闭连接
	elog.Flush()

}
예제 #2
0
func (s *TcpServer) Exit() {

	s.eventDispatch.Close()
	s.stopChan <- false
	close(s.stopChan)
	elog.LogSys(" close new conn ch ")
	close(s.newConnCh)
	elog.LogSys(" end  new conn ch ")
	elog.LogSys("wait...")

	s.waitGroup.Wait()
	elog.Flush()

}