Пример #1
0
        internal FakeAuctionServer(string itemId)
        {
            this.itemId = itemId;

            messages = new BlockingCollection <string>();

            client          = new ArtalkXmppClient(XMPP_HOSTNAME, String.Format(ITEM_ID_AS_LOGIN, itemId), AUCTION_PASSWORD);
            client.Message += OnNewMessage;
        }
Пример #2
0
        private void btnConnect_Click(object sender, EventArgs e)
        {
            client = new ArtalkXmppClient(txtServer.Text, txtUsername.Text, txtPassword.Text);

            client.Message += OnNewMessage;
            client.Connect();
            btnConnect.Enabled    = false;
            btnDisconnect.Enabled = true;
        }
Пример #3
0
        // GET: Home
        public ActionResult Index()
        {
            string hostname = "192.168.43.170";
            string username = "******";
            string password = "******";

            using (ArtalkXmppClient client = new ArtalkXmppClient(hostname, username, password))
            {
                // Setup any event handlers.
                // ...
                client.Connect();
                client.Dispose();
                Console.WriteLine("Type 'quit' to exit.");
                while (Console.ReadLine() != "quit")
                {
                    ;
                }
            }
            return(View());
        }
Пример #4
0
 private void ConnectToServer(string xmppHostname, string sniperId, string sniperPassword)
 {
     client          = new ArtalkXmppClient(xmppHostname, sniperId, sniperPassword);
     client.Message += OnNewMessage;
     client.Connect();
 }