Bladeren bron

send dx message

herlanS_ 3 jaren geleden
bovenliggende
commit
40270d73d0

BIN
classes/artifacts/ipphone_bridge_jar/ipphone-bridge.jar


+ 7 - 4
src/main/kotlin/co/id/datacomsolusindo/ipphonebridge/SocketChecker.kt

@@ -1,22 +1,25 @@
 package co.id.datacomsolusindo.ipphonebridge
 
-import org.apache.logging.log4j.LogManager
 import org.springframework.messaging.handler.annotation.DestinationVariable
 import org.springframework.messaging.handler.annotation.MessageMapping
 import org.springframework.messaging.handler.annotation.SendTo
 import org.springframework.stereotype.Controller
 
 @Controller
-class SocketChecker {
+class SocketChecker() {
 
     @MessageMapping("/hi")
     @SendTo("/topic/healthCheck")
     @Throws(Exception::class)
     fun greeting(message: MutableMap<*, *>): MutableMap<*, *> {
-        return mutableMapOf(Pair("Hi", "I'am Ok"))
+        return if (!ClientHolder.get().containsKey(message["Hi"])) {
+            mutableMapOf(Pair("Hi", "I'am Ok"), Pair("dc", message["Hi"]))
+        } else {
+            mutableMapOf(Pair("Hi", "I'am Ok"))
+        }
     }
 
-    fun collectChunk(message: SocketChunkData, id: String){
+    fun collectChunk(message: SocketChunkData, id: String) {
         if (message.totalPart == 1) {
 //                println("one part only with id $id")
             Singletons.responseQue.getOrPut(id) {

+ 4 - 0
src/main/resources/META-INF/MANIFEST.MF

@@ -0,0 +1,4 @@
+Manifest-Version: 1.0
+Main-Class: co.id.datacomsolusindo.ipphonebridge.IpPhoneBridgeApplicatio
+ nKt
+