Question

namespace TinyChat
{
    class Program
    {
        NetConnection Client;

        static void Main(string[] args)
        {
            Program TinyChat_Function = new Program();
            TinyChat_Function.connectTinyChat();
        }
        void connectTinyChat()
        {
            Client = new NetConnection();
            Client.OnConnect += new ConnectHandler(Client_OnConnect);
            Client.NetStatus += new NetStatusHandler(Client_NetStatus);

            Client.Connect("rtmp://209.212.144.77:443/tinyconf", new string[] { "SomeRoom", "none", "show", "tinychat" }); 
        }
    }

Errors:

1 The name 'Client_OnConnect' does not exist in the current context
2 The name 'Client_netStatus' does not exist in the current context

Using latest version of FluorineFx.

The documentation shows that this is the right way to do this, but this does not work. Any ideas on how i can solve this problem?

The documentation can be found here.

Était-ce utile?

La solution

Where is the code for the Client_OnConnectevent handler and the Client_NetStatusevent handlers? You are adding the events here in your lines , but you didn't implement the code. Unless you forgot to paste it in the question.

Client.OnConnect += new ConnectHandler(Client_OnConnect);
Client.NetStatus += new NetStatusHandler(Client_NetStatus);

You if you look at the documentation link this is the code

void netConnection_OnConnect(object sender, EventArgs e)
{
    //The NetConnection object is connected now
    netConnection.Call("serverHelloMsg", new ServerHelloMsgHandler(), "some text");
}

You should replace netConnection_OnConnect to Client_OnConnect and write the code in the method, maybe like this

void Client_OnConnect(object sender, EventArgs e)
{


 //handle connection below and do whatever needs to be done

}
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top