Not logged in. · Lost password · Register
Forum: MatriX RSS
Avatar
vishwa #1
Member since May 2013 · 22 posts
Group memberships: Members
Show profile · Link to this post
Subject: StreamActive is true while network disconnects
Hi,

I have few issues in network disconnection and re-connection.

1. Suppose I am connected with VPN, and after the login, client loads the all contacts, during this time, If my VPN disconnects then xmpp_Close() event fires automatically. But After successful loading of all contacts, if VPN disconnects then close() event does not calls.
Is this default behaviour of Matrix Client.

2. During the chat, if my network is disconnected, then StreamActive flag value does not change to false.  Should I require to call the Close() function forcefully or it automatically close in case of network disconnection.

Please resolve these queries.

Thanks
Vishwa
Avatar
Alex #2
Member since Feb 2003 · 4322 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
don't rely on the StreamActive flag. Subscribe to the OnClose event, it always fires when MatriX detected the loss of a connection. And also be aware that it can take some time until the .NET stack forwards the socket error to MatriX.
Also make sure that you use a recent binary, because we made lots of improvements there in the last weeks.
Avatar
vishwa #3
Member since May 2013 · 22 posts
Group memberships: Members
Show profile · Link to this post
In reply to post #1
Is there any event is available to check whether the connection is active or not. On network re-connection we need to check status of connection. I am getting the error "Open method cannot called on active stream".
Avatar
Alex #4
Member since Feb 2003 · 4322 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
until you get the OnClose its Open. And you should not call Open again when you did not get the OnClose before.
I have attached a reconnect example, I hople this helps you.

Alex
The author has attached one file to this post:
Reconnect.rar 3.3 kBytes
You have no permission to open this file.
Avatar
vishwa #5
Member since May 2013 · 22 posts
Group memberships: Members
Show profile · Link to this post
Thanks for providing sample. We are using the Matrix ver 1.5.1.1, can you please provide the change log for ver 1.5.3.6.

Vishwa
Avatar
Alex #6
Member since Feb 2003 · 4322 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
http://www.ag-software.net/matrix-xmpp-sdk/changelog/
Avatar
vishwa #7
Member since May 2013 · 22 posts
Group memberships: Members
Show profile · Link to this post
Hi,
Is their a way to bypass the VPN connection and connect xmpp directly from default network adaptor.

Thanks
Vishwa
Avatar
Alex #8
Member since Feb 2003 · 4322 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
we are using standard .NET sockets to setup the connection. I don't think that there is a way.
Avatar
vishwa #9
Member since May 2013 · 22 posts
Group memberships: Members
Show profile · Link to this post
Please provide the list of exceptions catched in OnError event, which can cause xmpp client connection disconnection.

Thanks
Vishwa
Avatar
jnguyen #10
Member since Jul 2013 · 1 post
Group memberships: Members
Show profile · Link to this post
I am seeing a similar problem.

We had been using the streamactive property with a connection monitor to reconnect. I re-factored to reconnect on an onclose event. I am still seeing excessive disconnect/reconnects. Our setup:

- openfire 3.7.1 & 3.8.2
- matrix 1.5.3.1 & 1.5.3.6
- socket connection
- keepaliveinteral = 30
- high incoming traffic rate (> 30 messages /sec)
- high latency (~96 ms ping response)

A couple of observations:

- disconnect happens more often using 1.5.3.6 than 1.5.3.1.
- most (>90%) disconnects happen without a preceding exception or error event
- streamcompression helps, but does not resolve the issue
- the incoming message rate should be ~ 30 /sec but the actual rate is ~15 /sec

It seems that the network cannot handle the higher xmpp message rate and lags behind. Once it lags behind to about 1 minute. The connection is dropped. Since we're seeing connection drops without errors or exceptions, would this be client or server causing the disconnect?
Avatar
Alex #11
Member since Feb 2003 · 4322 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Matrix does not close or disconnect the session on its own.
You should not send more data than your network, your server or the receiving client can handle and process.

When you send more data than your network can handle, the outgoing queue fills up. When your server is using XMPP poing to detect dead clients and your server expects a reply to a server ping in eg. 30 seconds then this is very likely the reason why your server is kicking your session.

I think you should reconsider the design of your software. Sending out a huge amount of data without some logic which checks the processing on the receiving entity and makes sure that your network can handle this amount of data is not good.

Alex
This post was edited on 2013-07-04, 16:45 by Alex.
Avatar
vishwa #12
Member since May 2013 · 22 posts
Group memberships: Members
Show profile · Link to this post
Please provide the list of exceptions catched in OnError event, which can causes the xmpp client disconnection.

Thanks
Vishwa
Avatar
Alex #13
Member since Feb 2003 · 4322 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
I don't have such a list.
Whenever the connection is lost you get an OnClose. Normally you don't have to care about the OnError event.

The OnError is useful when you try to connect and it doesn't work for some reason, eg Internet is down. Then you get an OnError event.

Alex
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Forum: MatriX RSS