Subject: Reconnecting to BOSH Server Getting Remote Server returned an Error (404 Not Found)
Hi,
I have added a logic in OnError Event to Reconnect to the BOSH Server. The reason is to try connecting to server though server is not available so that whenever next time server is up, connection is established automatically.
However When I am trying to reconnect it I am getting an error "Remote Server returned an Error (404 Not Found)" for subsequent reconnection though server is up and running. My code looks like below
Below is the snippet of the code in reconnect
Please let me know any reason for getting above error
I have added a logic in OnError Event to Reconnect to the BOSH Server. The reason is to try connecting to server though server is not available so that whenever next time server is up, connection is established automatically.
However When I am trying to reconnect it I am getting an error "Remote Server returned an Error (404 Not Found)" for subsequent reconnection though server is up and running. My code looks like below
- private void session_OnError(object sender, Matrix.ExceptionEventArgs e) {
- canReconnect = true;
- Reconnect();
- }
Below is the snippet of the code in reconnect
- xmpp.SetXmppDomain(DomainName);
- xmpp.Port = Convert.ToInt32(5222);
- xmpp.Username = "UserName";
- xmpp.Password = "UserPassword";
- xmpp.Resource = "Resource";
- xmpp.Hostname = "HostNameOfServer";
- xmpp.KeepAliveInterval=100;
- if (SocketConnectionType.ToLower().Equals("bosh")) {
- xmpp.Transport = Matrix.Net.Transport.Bosh;
- }
- OnNewMessageEvent(o, n.Message);
- });
- xmpp.Open();
Please let me know any reason for getting above error