func (t *TCPNetwork) DisconnectAllConnectionsClient() {
	for k, c := range t.connsForClient {
		c.Close()
		delete(t.connsForClient, k)
	}
}
DisconnectAllConnectionsClient disconnect all connections on client side
package tcpnetwork
import (
	"net"
	"sync/atomic"
	"time"
)
const (
	kServerConf_SendBufferSize = 1024
	kServerConn                = 0
	kClientConn                = 1
)
type TCPNetworkConf struct {
	SendBufferSize int
}
type TCPNetwork struct {
	streamProtocol  IStreamProtocol
	eventQueue      chan *ConnEvent
	listener        net.Listener
	Conf            TCPNetworkConf
	connIdForServer int
	connIdForClient int
	connsForServer  map[int]*Connection
	connsForClient  map[int]*Connection
	shutdownFlag    int32
	readTimeoutSec  int
}
func NewTCPNetwork(eventQueueSize int, sp IStreamProtocol) *TCPNetwork {
	s := &TCPNetwork{}
	s.eventQueue = make(chan *ConnEvent, eventQueueSize)
	s.streamProtocol = sp
	s.connsForServer = make(map[int]*Connection)
	s.connsForClient = make(map[int]*Connection)
	s.shutdownFlag = 0
	s.Conf.SendBufferSize = kServerConf_SendBufferSize
	return s
}
func (t *TCPNetwork) Push(evt *ConnEvent) {
	if nil == t.eventQueue {
		return
	}
	for {
		select {
		case t.eventQueue <- evt:
			{
				return
			}
		case <-time.After(time.Second * 5):
			{
				if evt.EventType == KConnEvent_Disconnected {
					continue
				}
				evt.Conn.close()
				return
			}
		}
	}
}
func (t *TCPNetwork) Pop() *ConnEvent {
	evt, ok := <-t.eventQueue
	if !ok {
		return nil
	}
	return evt
}
func (t *TCPNetwork) GetEventQueue() <-chan *ConnEvent {
	return t.eventQueue
}
func (t *TCPNetwork) Listen(addr string) error {
	ls, err := net.Listen("tcp", addr)
	if nil != err {
		return err
	}
	t.listener = ls
	go t.acceptRoutine()
	return nil
}
func (t *TCPNetwork) Connect(addr string) (*Connection, error) {
	conn, err := net.Dial("tcp", addr)
	if nil != err {
		return nil, err
	}
	connection := t.createConn(conn)
	connection.from = 1
	connection.run()
	connection.init()
	return connection, nil
}
func (t *TCPNetwork) GetStreamProtocol() IStreamProtocol {
	return t.streamProtocol
}
func (t *TCPNetwork) SetStreamProtocol(sp IStreamProtocol) {
	t.streamProtocol = sp
}
func (t *TCPNetwork) GetReadTimeoutSec() int {
	return t.readTimeoutSec
}
func (t *TCPNetwork) SetReadTimeoutSec(sec int) {
	t.readTimeoutSec = sec
}
func (t *TCPNetwork) DisconnectAllConnectionsServer() {
	for k, c := range t.connsForServer {
		c.Close()
		delete(t.connsForServer, k)
	}
}