|
@@ -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) {
|