Esempio n. 1
0
        void ConnectThread()
        {
            try
            {
                AuthService authService = new AuthService(ConnectionData.Region.LoginQueueURL, ConnectionData.Proxy.LoginQueueProxy);
                // Get an Auth token (Dumb, assumes no queueing, blocks)
                AuthResponse = authService.Authenticate(ConnectionData.User, ConnectionData.Password);
            }
            catch (WebException exception)
            {
                ConnectCallback(new RPCConnectResult(exception));
                return;
            }

            // Initialise our RTMPS connection
            RPCNetConnection = new NetConnection();
            RPCNetConnection.Proxy = ConnectionData.Proxy.RTMPProxy;

            // We should use AMF3 to behave as closely to the client as possible.
            RPCNetConnection.ObjectEncoding = ObjectEncoding.AMF3;

            // Setup handlers for different network events.
            RPCNetConnection.OnConnect += new ConnectHandler(NetConnectionOnConnect);
            RPCNetConnection.OnDisconnect += new DisconnectHandler(NetConnectionOnDisconnect);
            RPCNetConnection.NetStatus += new NetStatusHandler(NetConnectionNetStatus);

            // Connect to the RTMPS server
            RPCNetConnection.Connect(ConnectionData.Region.RPCURL);
        }