Esempio n. 1
0
        public ConnectionHandler(TcpClient c, JobQueue _queue, string _hostName, ConcurrentDictionary <string, List <Gearman.Connection> > _workers)
        {
            try {
                hostName  = _hostName;
                abilities = new List <string>();
                queue     = _queue;
                workers   = _workers;

                client = c;
                conn   = new Gearman.Connection(c.Client);

                IPAddress remoteIP = ((IPEndPoint)c.Client.RemoteEndPoint).Address;
                GearmanServer.Log.Info(String.Format("Connection made by {0}", remoteIP));

                Thread t = new Thread(new ThreadStart(run));
                t.Start();
            } catch (Exception e) {
                GearmanServer.Log.Error("Problem getting remote IP: ", e);
            }
        }
Esempio n. 2
0
        public ConnectionHandler(TcpClient c, JobQueue _queue, string _hostName, ConcurrentDictionary<string, List<Gearman.Connection>> _workers)
		{
			try {
                hostName = _hostName;
				abilities = new List<string>(); 
				queue = _queue;
                workers = _workers; 

                client = c;
				conn = new Gearman.Connection(c.Client);

				IPAddress remoteIP = ((IPEndPoint)c.Client.RemoteEndPoint).Address;
				GearmanServer.Log.Info(String.Format("Connection made by {0}", remoteIP)); 
			
				Thread t = new Thread(new ThreadStart(run)); 
				t.Start(); 
				
			} catch (Exception e) {
				GearmanServer.Log.Error("Problem getting remote IP: ", e);
			}		   		
			
		}