Ejemplo n.º 1
0
        public static void FlowManagerClose()
        {
            if (TcpClient != null)
            {
                TcpClient.Dispose();
                TcpClient = null;
            }

            if (ClearMemoryTimer != null)
            {
                ClearMemoryTimer.Dispose();
            }
            GC.Collect();
        }
Ejemplo n.º 2
0
        public static void InitTcpClient(string remoteIp)
        {
            if (TcpClient == null || !TcpClient.IsClientConnected || TcpClient.IsClosed)
            {
                if (TcpClient != null)
                {
                    TcpClient.Dispose();
                }

                TcpClient = new IOFlowTCPClient();
                TcpClient.OnConnectedServer       += TcpClient_OnConnectedServer;
                TcpClient.OnDisConnectedServer    += TcpClient_OnDisConnectedServer;
                TcpClient.OnExceptionHanped       += TcpClient_OnExceptionHanped;
                TcpClient.OnPublishProject        += TcpClient_OnPublishProject;
                TcpClient.OnPublishProjectFault   += TcpClient_OnPublishProjectFault;
                TcpClient.OnPublishProjectSuccess += TcpClient_OnPublishProjectSuccess;
                TcpClient.OnTCPClientLoged        += TcpClient_OnTCPClientLoged;
                TcpClient.OnPublishing            += TcpClient_OnPublishing;
                TcpClient.Start(remoteIp);
            }
        }