Abdul Basit
11/30/2023, 4:28 PM3502
(connection stale ) and the connection disconnects.
any idea what is happening ?Alexander Maryanovsky
11/30/2023, 4:45 PMAbdul Basit
11/30/2023, 4:45 PMAbdul Basit
11/30/2023, 4:46 PMKirill Grouchnikov
11/30/2023, 5:19 PMmain()
function with no compose bits, build it in release mode, and file a bug in https://github.com/centrifugal/centrifuge-java/issuesMichael Paus
11/30/2023, 5:43 PMAbdul Basit
12/01/2023, 4:52 AMbuildTypes.release {
proguard {
obfuscate.set(false)
configurationFiles.from("<http://compose-desktop.pro|compose-desktop.pro>")
}
}
but still having same issue.
Let me try to run this with no compose.Abdul Basit
12/01/2023, 5:19 AMMichael Paus
12/01/2023, 8:36 AMbuildTypes.release {
proguard {
version.set("7.4.0")
isEnabled.set(false)
optimize.set(false)
obfuscate.set(false)
configurationFiles.from(project.file("<http://compose-desktop.pro|compose-desktop.pro>"))
}
}
You have just disabled the obfuscation but not ProGuard completely. I’d try with my snippet above first and if it works enable ProGuard via the isEnabled parameter. I normally leave the others disabled because for desktop they don’t seem to have a significant effect but just make the build less predictable.Abdul Basit
12/01/2023, 2:17 PMMichael Paus
12/01/2023, 3:51 PMAbdul Basit
12/01/2023, 3:53 PMAbdul Basit
12/01/2023, 3:56 PMfun App() {
val centrifuge = Client(
SOCKET_CONNECTION_LINK,
Options(),
object : EventListener() {
override fun onConnected(client: io.github.centrifugal.centrifuge.Client?, event: ConnectedEvent?) {
super.onConnected(client, event)
println("Connected")
}
override fun onDisconnected(client: io.github.centrifugal.centrifuge.Client?, event: DisconnectedEvent?) {
super.onDisconnected(client, event)
println("Disconnected")
}
override fun onError(client: Client?, event: ErrorEvent?) {
super.onError(client, event)
println("Error ${event?.error?.message}")
}
}
)
// Subscribe to a channel and handle incoming data
val channel = socketChannel
val subscription = centrifuge.newSubscription(channel,
object : SubscriptionEventListener() {
override fun onPublication(sub: Subscription, event: PublicationEvent) {
println("Published message ${String(event.data, StandardCharsets.UTF_8)}")
}
override fun onError(sub: Subscription?, event: SubscriptionErrorEvent?) {
super.onError(sub, event)
println("Error ${event?.error?.message}")
}
}
)
try {
centrifuge.connect()
subscription.subscribe()
} catch (e: Exception) {
e.printStackTrace()
}
}
Abdul Basit
12/05/2023, 3:03 PMMichael Paus
12/05/2023, 3:12 PMincludeAllModules = true
in the nativeDistributions
section.Abdul Basit
12/05/2023, 3:17 PMincludeAllModules = true
Thank you so much @Michael Paus 🙇Michael Paus
12/05/2023, 3:18 PMsuggestModules
and if that is not sufficient try to find the necessary modules manually.Abdul Basit
12/05/2023, 3:25 PM