. jejeje.

it had rejectClient in the connect function ....

:-)



2007/2/6, Aizen <[EMAIL PROTECTED]>:

I again.. :-)

that is the application is not connected..!
in wrapper.conf I added the way of Application class
that I defined in webapps/prueba1/classes

Inside wrapper.conf
wrapper.java.classpath.69=../webapps/prueba1/WEB-INF/classes

In red5-web.xml
<bean id="web.handler"
        class="com.miclase.Application"
        singleton="true" />


Application.class Code
package com.miclase;

/*
 * RED5 Open Source Flash Server - http://www.osflash.org/red5
 *
 * Copyright (c) 2006 by respective authors (see below). All rights
reserved.
 *
 * This library is free software; you can redistribute it and/or modify it
under the
 * terms of the GNU Lesser General Public License as published by the Free
Software
 * Foundation; either version 2.1 of the License, or (at your option) any
later
 * version.
 *
 * This library is distributed in the hope that it will be useful, but
WITHOUT ANY
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A
 * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
details.
 *
 * You should have received a copy of the GNU Lesser General Public
License along
 * with this library; if not, write to the Free Software Foundation, Inc.,

 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 */

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.red5.samples.components.ClientManager;
import org.red5.server.adapter.ApplicationAdapter;
import org.red5.server.api.IConnection ;
import org.red5.server.api.IScope;
import org.red5.server.api.service.ServiceUtils;

/**
 * Sample application that uses the client manager.
 *
 * @author The Red5 Project ([email protected])
 * @author Joachim Bauch ([EMAIL PROTECTED])
 * @see org.red5.samples.components.ClientManager
 */
public class Application extends ApplicationAdapter {

    protected static Log log = LogFactory.getLog(Application.class.getName
());

    /** Manager for the clients. */
    private ClientManager clientMgr = new ClientManager("clientlist",
false);

    @Override
    public boolean connect(IConnection conn, IScope scope, Object[]
params) {
        // Check if the user passed valid parameters.
        if (params == null || params.length == 0) {
            log.debug("Client didn't pass a username.");
            // NOTE: "rejectClient" terminates the execution of the
current method!
            rejectClient("No username passed.");
        }

        // Call original method of parent class.
        if (!super.connect(conn, scope, params)) {
            return false;
        }

        String username = params[0].toString();
        String uid = conn.getClient().getId();
        log.debug("Client \"" + username + "\" (" + uid + ") connected.");

        // Register the user in the shared object.
        clientMgr.addClient(scope, username, uid);

        // Notify client about unique id.
        ServiceUtils.invokeOnConnection (conn, "setClientID",
                new Object[] { uid });
        return true;
    }

    @Override
    public void disconnect(IConnection conn, IScope scope) {
        // Get the previously stored username.
        String uid = conn.getClient().getId();
        // Unregister user.
        String username = clientMgr.removeClient(scope, uid);
        if (username != null) {
            log
                    .debug("Client \"" + username + "\" (" + uid
                            + ") disconnected.");
        } else {
            log.debug("Client (" + uid + ") disconnected.");
        }
        // Call original method of parent class.
        super.disconnect(conn, scope);
    }

}


ActionScript Code

nc = new NetConnection()
nc.connect ("rtmp://localhost/prueba1");
nc.onStatus = function(i){
if (info.code == "NetConnection.Connect.Success") {
        trace("Conectado..");
    } else {
        trace("Desconectado");
    }
}


That it is what I am making bad.

greetings :-)


_______________________________________________
Red5 mailing list
[email protected]
http://osflash.org/mailman/listinfo/red5_osflash.org

Reply via email to