public void run()
    {
        System.out.println("Server Running on port " + this.port);
        
        while(true)
        {
            try
            {
                selector.select();
                Set<SelectionKey> keys = selector.selectedKeys();
                for(Iterator<SelectionKey> i = keys.iterator(); i.hasNext();)
                {
                    SelectionKey key = i.next();
                    i.remove();
                    
                    Channel c = key.channel();
                    
                    if(key.isAcceptable() && c == tcp)
                    {
                        new Thread(new Handler(this, tcp.accept().socket(), 
                            "TCP")).start();
                    }
                    else if(key.isReadable() && c == udp)
                    {
                        new Thread(new Handler(this, udp, "UDP")).start();
                    }
                }
            }
            catch (Exception e)
            {
                e.printStackTrace();
            }
        }
    }