2

我正在尝试创建一个将连接到 FluorineFx RTMP 服务的 .NET 消费者客户端。创建 Flex 消费者客户端非常容易,我希望在 .NET 中创建相同的客户端

(换句话说,如何将 MessageAdapter 连接到 MessageAdapter?)

非常感谢,

嘟嘟

4

1 回答 1

2

我正在使用 NetConnection 对象,对我来说效果很好。检查文档页面

using FluorineFx.Net;
...
NetConnection netConnection = new NetConnection();
netConnection.OnConnect += new ConnectHandler(netConnection_OnConnect);
netConnection.NetStatus += new NetStatusHandler(netConnection_NetStatus);
netConnection.Connect("rtmp://localhost:1935/HelloWorld");
...
void netConnection_OnConnect(object sender, EventArgs e)
{
    //The NetConnection object is connected now
    netConnection.Call("serverHelloMsg", new ServerHelloMsgHandler(), "some text");
}
...
void netConnection_NetStatus(object sender, NetStatusEventArgs e)
{
    string level = e.Info["level"] as string;
}
...
//Our result handler object
public class ServerHelloMsgHandler : IPendingServiceCallback
{
    public void ResultReceived(IPendingServiceCall call)
    {
        object result = call.Result;
    }
}
于 2010-02-23T16:56:34.383 回答