Example #1
0
 public void startService()
 {
     try
     {
         Console.WriteLine(Convert.ToInt32(this.CloudPort));
         server      = new transportServer(Convert.ToInt32(this.CloudPort));
         sockests    = new List <TcpClient>();
         reqListener = new transportServer.NewClientHandler(newClientRequest);
         msgListener = new transportServer.NewMsgHandler(newMessageRecived);
         server.OnNewClientRequest  += reqListener;
         server.OnNewMessageRecived += msgListener;
         if (server.isStarted())
         {
             addLog(this.logs, Constants.SERVICE_START_OK, Constants.LOG_INFO);
         }
         else
         {
             addLog(this.logs, Constants.SERVICE_START_ERROR, Constants.LOG_ERROR);
         }
     }
     catch
     {
         addLog(this.logs, Constants.SERVICE_START_ERROR, Constants.LOG_ERROR);
     }
 }
Example #2
0
        public void stopServer()
        {
            foreach (KeyValuePair <string, TcpClient> entry in clientSockets)
            {
                server.endConnection(entry.Value);
            }

            server.OnNewClientRequest  -= reqListener;
            server.OnNewMessageRecived -= msgListener;
            reqListener = null;
            msgListener = null;
            server.stopServer();
            server = null;
        }
Example #3
0
 public bool startManager(int port)
 {
     try
     {
         server = new transportServer(port);
         clientHandler = new transportServer.NewClientHandler(newClientRequest);
         server.OnNewClientRequest += clientHandler;
         logs.addLogFromOutside(Constants.MANAGER_STARTED, true, Constants.INFO);
         return true;
     }
     catch
     {
         return false;
     }
 }
Example #4
0
 public void stopManager()
 {
     try
     {
         server.OnNewClientRequest -= clientHandler;
         clientHandler              = null;
         server.stopServer();
         //server = null;
     }
     catch
     {
         GC.Collect();
         logs.addLogFromOutside("Problems with disconnecting", true, Constants.LOG_ERROR);
     }
 }
Example #5
0
 public bool startManager(int port)
 {
     try
     {
         server                     = new transportServer(port);
         clientHandler              = new transportServer.NewClientHandler(newClientRequest);
         server.OnNewClientRequest += clientHandler;
         //logs.addLogFromOutside(Constants.MANAGER_STARTED, true, Constants.INFO);
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Example #6
0
        public void stopManager()
        {
            try
            {
                foreach (TcpClient client in server.clientSocket)
                {
                    server.endConnection(client);
                }

                server.OnNewClientRequest -= clientHandler;
                clientHandler              = null;
                server.stopServer();
                server = null;
            }
            catch
            {
                logs.addLogFromOutside("Problems with disconnecting", true, Constants.LOG_ERROR);
            }
        }
Example #7
0
        public void stopServer()
        {
            foreach (KeyValuePair<string, TcpClient> entry in clientSockets)
            {
                server.endConnection(entry.Value);
            }

            server.OnNewClientRequest -= reqListener;
            server.OnNewMessageRecived -= msgListener;
            reqListener = null;
            msgListener = null;
            server.stopServer();
            server = null;
        }
Example #8
0
 public void startService()
 {
     try
     {
         Console.WriteLine(Convert.ToInt32(this.CloudPort));
         server = new transportServer(Convert.ToInt32(this.CloudPort));
         sockests = new List<TcpClient>();
         reqListener = new transportServer.NewClientHandler(newClientRequest);
         msgListener = new transportServer.NewMsgHandler(newMessageRecived);
         server.OnNewClientRequest += reqListener;
         server.OnNewMessageRecived += msgListener;
         if (server.isStarted())
         {
             addLog(this.logs, Constants.SERVICE_START_OK, Constants.LOG_INFO);
         }
         else
         {
             addLog(this.logs, Constants.SERVICE_START_ERROR, Constants.LOG_ERROR);
         }
     }
     catch
     {
         addLog(this.logs, Constants.SERVICE_START_ERROR, Constants.LOG_ERROR);
     }
 }
Example #9
0
        public void stopManager()
        {
            try
            {
                foreach (TcpClient client in server.clientSocket)
                {
                    server.endConnection(client);
                }

                server.OnNewClientRequest -= clientHandler;
                clientHandler = null;
                server.stopServer();
                server = null;
            }
            catch
            {
                logs.addLogFromOutside("Problems with disconnecting", true, Constants.LOG_ERROR);
            }
        }
Example #10
0
        public void stopManager()
        {
            try
            {

                server.OnNewClientRequest -= clientHandler;
                clientHandler = null;
                server.stopServer();
                //server = null;
            }
            catch
            {
                GC.Collect();
                logs.addLogFromOutside("Problems with disconnecting", true, Constants.LOG_ERROR);
            }
        }