0
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" }); 
        }
    }

错误:

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

使用最新版本的 FluorineFx。

文档显示这是执行此操作的正确方法,但这不起作用。关于如何解决这个问题的任何想法?

文档可以在这里找到。

4

1 回答 1

0

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

}
于 2013-05-25T18:01:38.370 回答