Advertisement
Guest User

Untitled

a guest
Feb 19th, 2020
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.45 KB | None | 0 0
  1. using System;
  2. using System.Net;
  3. using Communication.Global;
  4. using Communication.Matrix;
  5. using Communication.Messaging;
  6. using Communication.Messaging.Model;
  7. using DotNetty.Transport.Channels;
  8. using Matrix;
  9. using Matrix.Network;
  10. using Matrix.Network.Resolver;
  11. using Matrix.Sasl;
  12. using Matrix.Srv;
  13. using Matrix.Xml;
  14.  
  15. namespace TestApp
  16. {
  17. class Program
  18. {
  19. static void Main(string[] args)
  20. {
  21. // var im = new InstantMessenger
  22. // {
  23. var user = new XmppUser()
  24. {
  25. NickName = "WPF 1.0_77780f8f-7575-4700-be16-af021e713460",
  26. Password = "6)Bpg|D+8GfWaa^};!52u&KtwC!>69E]",
  27. Server = "qaim.dataonix.com",
  28. User = "77780f8f-7575-4700-be16-af021e713460",
  29. Resource = null,
  30. };
  31. // };
  32. // im.Login();
  33. // var srv = new MyMatrixService();
  34. // srv.Connect("im-nonprod.dataonix.com", user);
  35. var xmpp = new XmppClient()
  36. {
  37. // Compression = true,
  38. // CertificateValidator = new AlwaysAcceptCertificateValidator(),
  39. // HostnameResolver = new SrvNameResolver(),
  40. // HostnameResolver = new StaticNameResolver("im-nonprod.dataonix.com", directTls: true, port: 5223),
  41. HostnameResolver = new StaticNameResolver("im-nonprod.dataonix.com", port: 5232),
  42. Resource = IMSettings.RESOURCE,
  43. // Port = 1234,
  44. // Port = 5233,
  45. // Port = 5232,
  46. Password = "6)Bpg|D+8GfWaa^};!52u&KtwC!>69E]",
  47. Username = "77780f8f-7575-4700-be16-af021e713460",
  48. XmppDomain = "qaim.dataonix.com",
  49. // SaslHandler = new DefaultSaslHandler() { },
  50. // Tls = true,
  51. // TlsHandlerProvider = new DefaultClientTlsHandlerProvider(),
  52. // RegistrationHandler = null,
  53. // TlsSettingsProvider = new DefaultClientTlsSettingsProvider(),
  54. };
  55. // var task1 = xmpp.HostnameResolver.ResolveAsync(new DnsEndPoint("im-nonprod.dataonix.com", xmpp.Port));
  56. // task1.Wait(5000);
  57. var task = xmpp.ConnectAsync();
  58. task.Wait(10000);
  59. //Console.WriteLine(task.Exception);
  60. Console.WriteLine(task.Result);
  61. Console.WriteLine("Hello World!");
  62. }
  63. }
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement