Switching to 4.5.0-rc1 to use Websockets?

Hi All

I have been using 4.4.8 in my android app for quite a while now but have updated to 4.5.0-rc1 to try to take advantage of the websockets feature that has been added.

I’ve searched the forums and googled and tried AI too to find out how to do this. There just doesn’t seem to be much info on it.

The example code uses the Modular connection mechanism but this isn’t recommended for production systems due to being quite new?

This is my relatively simple code that uses a straightforward TCP connection. How would I make this use websockets instead?

XMPPTCPConnectionConfiguration.builder()

.setHost(serverIp)
.setPort(mPort)
.setXmppDomain(mServer)
.setResource(resourceString)
.setSecurityMode(ConnectionConfiguration.SecurityMode.required)
.setCompressionEnabled(false)
.setSendPresence(true)
.setLanguage(Locale.US) .apply {

if (socketFactory != null) {

setSocketFactory(socketFactory)
}
} .build()

// Create connection with the config

val connection = XMPPTCPConnection(config)

connection?.connect()?.also { conn →

conn.login(mUserId, xmppPassword)

}