Project

General

Profile

A problem with c2s connections: Attempt to add different service with the same ID

cena cena
Added over 4 years ago

Hi, I am getting a problem about user login as title. our android software will reconnect the server frequently because of the unstable hardware. After running for a period of time, the server keep printing the following logs:

2014-08-11 08:07:54.095 [ConnectionOpenThread] ConnectionManager.serviceStarted() WARNING: c2s: Attempt to add different service with the same ID: null, type: accept, Socket: nullSocket[addr=/60.174.205.17,port=1062,localport=5222], jid: null

2014-08-11 08:07:58.517 [ConnectionOpenThread] ConnectionManager.serviceStarted() WARNING: c2s: Attempt to add different service with the same ID: null, type: accept, Socket: nullSocket[addr=/60.174.205.17,port=48685,localport=5222], jid: null

2014-08-11 08:08:28.857 [ConnectionOpenThread] ConnectionManager.serviceStarted() WARNING: c2s: Attempt to add different service with the same ID: null, type: accept, Socket: nullSocket[addr=/36.63.185.110,port=41030,localport=5222], jid: null

2014-08-11 08:09:14.183 [ConnectionOpenThread] ConnectionManager.serviceStarted() WARNING: c2s: Attempt to add different service with the same ID: null, type: accept, Socket: nullSocket[addr=/60.174.205.17,port=54144,localport=5222], jid: null

The android clients could not login again, but we use spark and pandion can successfully establish connections with the same user.

the init.properties configured as follow:

config-type=--gen-config-def

--admins=admin@tt.com

--virt-hosts =tt.com

--debug=server

--sm-plugins=-msgoffline,-amp,+message

--user-db=mysql

--user-db-uri=jdbc:mysql://172.168.6.203:3306/tigasedb521?user=root&password=root&useUnicode=true&characterEncoding=UTF-8

Can you give us some suggestions?

Thanks!


Replies (4)

Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam over 4 years ago

I do not think your login problems from Android client are caused by the server. The warning is printed when a new TCP/IP connection is opened while connection from the same IP and Port number is still opened on the Tigase server. This is an incorrect situation form the TCP/IP protocol point of view and Tigase discovers this and prints a warning. The old connection is then marked as invalid and Tigase treats the new connection is valid.

This happens usually, when a device or application reuses port number from previous TCP/IP connection.

My suggestion is, if your Android client cannot login, it should just close the current TCP/IP connection and try to login on a new connection. We do also have Android client (open source project) and it works very well.

Added by cena cena over 4 years ago

Artur Hefczyc wrote:

I do not think your login problems from Android client are caused by the server. The warning is printed when a new TCP/IP connection is opened while connection from the same IP and Port number is still opened on the Tigase server. This is an incorrect situation form the TCP/IP protocol point of view and Tigase discovers this and prints a warning. The old connection is then marked as invalid and Tigase treats the new connection is valid.

This happens usually, when a device or application reuses port number from previous TCP/IP connection.

My suggestion is, if your Android client cannot login, it should just close the current TCP/IP connection and try to login on a new connection. We do also have Android client (open source project) and it works very well.

But everytime the clients couldn't connect, we restarted the server and it worked. So I guess if the old connection would be cleaned immediately, and is there anything we can do on the server side?

Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam over 4 years ago

cena cena wrote:

But everytime the clients couldn't connect, we restarted the server and it worked. So I guess if the old connection would be cleaned immediately, and is there anything we can do on the server side?

You also said that even without restarting server, you could connect successfully from other clients - Spark, Pandion. So I do not think this is really an issue on the server side. At least it does not look like it. Have you tried to restart (completely shutdown and start up again) the Android client instead of the server? I think, there might be a connection in more or less broken state between the Android client and the server which goes in the way and causes a conflict. Have you also tried to somehow reset the TCP/IP connection on the client side?

Added by cena cena over 4 years ago

Artur Hefczyc wrote:

You also said that even without restarting server, you could connect successfully from other clients - Spark, Pandion. So I do not think this is really an issue on the server side. At least it does not look like it. Have you tried to restart (completely shutdown and start up again) the Android client instead of the server? I think, there might be a connection in more or less broken state between the Android client and the server which goes in the way and causes a conflict. Have you also tried to somehow reset the TCP/IP connection on the client side?

In fact, the clients' wifi module restart frequently that lead to the problem, but I'm not sure the TCP/IP connection would be reseted with the wifi restarting. I will turn to research the client and look forward to solve it.

Thanks for your response and suggestion!

    (1-4/4)