Example #1
0
func (tcpClient *TcpClient) Close() {

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

}
Example #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()

}