I’m a graduating student using Openfire to graduation project for instant messaging. The file transfer module is bothering me. There are the following situations happened:
Every time I transfer the file for the first time, it is successful.
Then from the second time, I would get this error in server log:
org.jivesoftware.openfire.handler.IQBindHandler - Conflicting resource binding request from vm-4-9-centos/6xtubt9pm2 using ezchat. Conflict count 1 is over the configured limit of 0. Returning conflict error to and closing session of OLD client (stream ID: 1l3acc8xss).
When I initialize every client connection, I will set the ezchat as the resource part. Though I read the XMPP doc, I still can not understand what the Conflicting resource binding is because I think I didn’t use the “6xtubt9pm2” at all and I could not find this in the database. Is it because the stream didn’t close properly or something? Can anyone help me pls!
Resource binding in XMPP has nothing to do with file transfer.
You appear to be launching a new Smack-based client for each file transfer. When a new XMPP connection is being established, “resource binding” takes place. This is a mechanism in which a specific identifier gets associated to the connection. This makes it possible for the same user to have multiple concurrent connections (each with a different ‘resource identifier’).
Your application appears to be using the same resource identifier for each connection. This causes a conflict, that you see being resolved in the server log.
This can be solved in a number of ways:
use a different resource identifier for each connection (or do not request a resource identifier, in which case the server will randomly generate one for a new connection)
close all old connections after usage, so that their resource identifier cannot clash with future connections.
do not start a new connection for each file transfer (instead, transfer files using the pre-existing connection).