Ejemplo n.º 1
0
        public static bool SendCommand(string command)
        {
            using (var client = new XmppClient("xmppeval.cloudapp.net", "webazure", "abcd"))
              {
            client.Connect();
            client.SendMessage(Jid, command);
              }

              return true;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// The count of _pingTimers expired, and still client is disconnected
        /// </summary>

        /// Constructor of S22Comms. Setups communications and file transfer entities.
        /// Important notice: no actul connection yet takes place
        public SharpComms(String jid, String passphrase, string resource, IUIThreadDispatcher uidis)
        {
            if (passphrase == null || jid == null)
            {
                throw new ArgumentNullException("Provided null arguments to S22Comms constructor");
            }
            uiDispatcher = uidis;

            string[] temp = jid.Split(new Char[] { '@' });
            _defaultNet = temp[1]; //After the first @
            _defaultUser = temp[0]; //Before the first @
            _resource = resource;   //Resource provided in Constructor

            xmppClient = new XmppClient(_defaultNet, _defaultUser, passphrase);
            xmppClient.DefaultTimeOut = DefaultTimeOut;
            //Define the ping period multiplierf and the internal ping period

            remoteRosterList = new List<RosterItem>();
            //Method fired when a subscription request arrives
            xmppClient.SubscriptionRequest = SubScribeRequest;
            //Event fired when Subscription request has been approved.
            xmppClient.SubscriptionApproved += presenceMgt_OnSubscribed;
            //Event fired when Remote user or resource unsubscribed from receiving presence notifications
            xmppClient.Unsubscribed += presenceMgt_OnUnsubscribed;
            //Event fired when presence is detected
            xmppClient.StatusChanged += xmppClient_OnPresence;
            //Event fired when protocol error detected
            xmppClient.Error += xmppClient_OnError;
            //Event fired when Roster Updated
            xmppClient.RosterUpdated += xmppClient_RosterUpdated;
            //Delegate for incoming file transfer events
            xmppClient.FileTransferRequest = fileTransferMgt_OnFile_Delegate;
            //Delegate for incoming file transfer events progress
            xmppClient.FileTransferProgress += _xmppClient_FileTransferProgress;
            // Receive Messagea
            xmppClient.Message += xmppClient_Message;
        }
Ejemplo n.º 3
0
 static XmppManager()
 {
     _client = new XmppClient("5.139.217.156", 5222, false);
     _client.Error += ClientOnError;
 }