protected boolean listen(){        
        try{
            switch(type){
                case RMI:      
                {
                    RMIServer = new WANRMIServer(this);                      
                    Naming.bind (name, RMIServer);
                    return true;                    
                }   
                
                case Corba:
                {
                    CORBAServer = new WANCorbaServer(this, Host, port, name);
                    return true;
                }
                
                case SocketUDP:
                    if(server){
                        d = new WANDatagram(this, Host, port, server);
                        return d.listen();                    
                    }else{
                        return false;
                    }
                case SocketTCP:
                    if(server){
                        s = new WANSocket(this, Host, port, server);
                        return s.listen();                    
                    }else{
                        return false;
                    }
            }
        }catch(Exception e){
            addLayerInfo("Wan interface", "Unknown error during connect: " + e.toString());
            e.printStackTrace();
        }
        return false;
    }