public virtual void Connect(string address, int module, int connector)
        {
            this.module    = module;
            this.connector = connector;
            this.address   = address;

            if (!connections.ContainsKey(address))
            {
                connections.Add(address, new TCPConnectionInfo());
                connections[address].macaddress = this.macaddress;

                connections[address].tcpclient.TCPStatusChange += ConnectionStatusChange;
                connections[address].tcpclient.InitializeClient(address, GCPORT, GCBUFFERSIZE);
            }
            else
            {
                connections[address].connectioncount++;
                onConnectionStatusChange(connections[address].SocketStatus);
                connections[address].tcpclient.TCPStatusChange += ConnectionStatusChange;
            }

            enabled = true;

            gcTCPClientRef = connections[address].tcpclient;
        }
        public virtual void Disconnect()
        {
            enabled = false;
            connections[this.address].connectioncount--;
            connections[address].tcpclient.TCPStatusChange -= ConnectionStatusChange;

            if (connections[this.address].connectioncount == 0)
            {
                connections[address].tcpclient.DisconnectFromServer();
                connections.Remove(address);
            }
            gcTCPClientRef = null;
        }
 public TCPConnectionInfo()
 {
     tcpclient       = new GlobalCacheTCPClient();
     connectioncount = 1;
 }