public void DoConnect(object s, EventArgs e)
        {
            Watch.Reset();
            Watch.Start();
            Log("Connecting...");
            client.ClusterUrl = ClusterUrl;

            if (!client.IsConnected)
            {
                State = ConnectionState.Connecting;
            }
            client.Connect(AppKey, Guid.NewGuid().ToString());
        }
示例#2
0
        /// <summary>
        /// Connects to the ORTC server
        /// </summary>
        /// <returns></returns>
        private bool ConnectToORTC()
        {
            Log(String.Format("Connecting to: {0} ", ORTC_SERVER_URL));

            ortcClient.ClusterUrl = ORTC_SERVER_URL;
            ortcClient.Connect(txtORTCAppKey.Text, txtORTCAuthToken.Text);

            return(true);
        }
        public MainPage()
        {
            this.InitializeComponent();

            // Establish the Realtime connection
            ortcClient              = new RealtimeFramework.Messaging.OrtcClient();
            ortcClient.OnConnected += OnConnected;
            ortcClient.OnException += OnException;

            ortcClient.ClusterUrl = "http://ortc-developers.realtime.co/server/2.1/";
            Log("Connecting to a Realtime server ...");
            ortcClient.Connect("2Ze1dz", "token");
        }
示例#4
0
 public void DoConnectDisconnect(object sender, RoutedEventArgs e)
 {
     if (ortcClient.IsConnected)
     {
         ortcClient.Disconnect();
         WriteLog("Disconnecting...");
     }
     else
     {
         ortcClient.ConnectionMetadata = ConnectionMetadata;
         if (IsCluster)
         {
             ortcClient.ClusterUrl = Url;
         }
         else
         {
             ortcClient.Url = Url;
         }
         ortcClient.Connect(ApplicationKey, AuthenticationToken);
         WriteLog("Connecting...");
     }
 }
示例#5
0
        public MessageManager()
        {
            ortcClient            = new OrtcClient();
            ortcClient.ClusterUrl = "http://ortc-developers.realtime.co/server/2.1/";

            // Ortc client handlers
            ortcClient.OnConnected  += (object sender) => {
            };
            ortcClient.OnSubscribed += (object sender, string channel) => {
            };
            ortcClient.OnException  += (object sender, Exception ex) => {
            };

            ortcClient.Connect(AppKey, Guid.NewGuid().ToString());
        }
示例#6
0
        private void btnConnect_Click(object sender, EventArgs e)
        {
            // Update URL with user entered text
            if (chkClientIsCluster.Checked)
            {
                _ortc.ClusterUrl = txtClientUrl.Text;
            }
            else
            {
                _ortc.Url = txtClientUrl.Text;
            }

            Log(String.Format("Connecting to: {0}...", txtClientUrl.Text));

            _ortc.ConnectionMetadata     = txtClientConnectionMetadata.Text;
            _ortc.AnnouncementSubChannel = txtClientAnnouncementSubChannel.Text;

            _ortc.Connect(txtClientAppKey.Text, txtClientToken.Text);
        }
示例#7
0
        void ConnectToORTC()
        {
            // Establish the Realtime connection
            ortcClient              = new OrtcClient();
            ortcClient.OnConnected += OnConnected;
            ortcClient.OnException += OnException;

            ortcClient.ClusterUrl = "http://ortc-developers.realtime.co/server/2.1/";
            //ortcClient.Connect("2Ze1dz", "token");
            ortcClient.Connect("jXNrX9", "token");
            Message message = new Message();

            message.sentAtDate = DateTime.Now.ToLocalTime().ToString("dd/MM/yyyy");
            if (message.sentAtDate != null)
            {
                TxtChat.Text      = message.sentAtDate;
                TxtSend.IsEnabled = true;
            }
        }
        IEnumerator ConnectAsync(string authToken)
        {
            Client.Connect(AppKey, authToken);

            // Wait for connection
            for (int i = 0; i < 120; i++)
            {
                if (Client.IsConnected)
                {
                    break;
                }

                //Logger.Log("Waiting for Ortc Connect");
                yield return(TaskManager.WaitForSeconds(1));
            }

            if (!Client.IsConnected)
            {
                throw new Exception("Failed to connect");
            }
        }
示例#9
0
        IEnumerator Connect()
        {
            yield return(1);

            // Update URL with user entered text
            if (ClientIsCluster)
            {
                _ortc.ClusterUrl = ClientURL;
            }
            else
            {
                _ortc.Url = ClientURL;
            }

            _ortc.ConnectionMetadata     = ClientMetaData;
            _ortc.AnnouncementSubChannel = ClientAnnouncmentSubChannel;
            _ortc.HeartbeatActive        = Heartbeat;

            Log(String.Format("Connecting to: {0}...", ClientURL));
            _ortc.Connect(ApplicationKey, AuthToken);
        }
示例#10
0
 private void connect()
 {
     _ortc.ClusterUrl = " http://ortc-developers.realtime.co/server/2.1";
     _ortc.Connect(Gappkey, Gapptoken);
     Console.WriteLine("Connected");
 }
示例#11
0
 public void Connect()
 {
     client.Connect(applicationKey, authenticationToken);
 }