Advertisement
Guest User

Untitled

a guest
Oct 12th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. public void ConnectToServer(string _serverName, string _username, string _password, string _nickName, int _port) {
  2.  
  3. _serverName = "plords.m.in-app.io";
  4. _username = "test_plords_0";
  5. _password = "password_0";
  6. client = new XmppClient(_serverName);
  7.  
  8. client.AutoRoster = false; //This can be used for the normal chat, not for notifications, it just retrieves the roster of users that you really do not care about
  9. client.AutoPresence = false;
  10. client.Transport = Matrix.Net.Transport.Socket;
  11. //int wsPort = 5280; //Temporary hardcoding until the solution is proven
  12.  
  13. client.OnMessage += OnMessage;
  14. client.OnClose += OnClose;
  15. client.OnLogin += OnLogin;
  16. client.OnBind += OnBind;
  17. client.OnBindError += OnBindError;
  18. client.OnAuthError += OnAuthError;
  19. client.OnError += OnError;
  20. client.OnStreamError += OnStreamError;
  21. client.OnXmlError += OnXmlError;
  22. client.OnPresence += OnPresence;
  23. client.StartTls = false;
  24.  
  25. client.KeepAliveInterval = 40;
  26. client.Username = _username;
  27. client.Password = _password;
  28. client.Uri = new Uri(String.Format("wss://plords.m.in-app.io:443/xmpp"));
  29. //client.Port = 5223;
  30. client.Open();
  31.  
  32. nickName = _username;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement