Kaynağa Gözat

1 on 1 multi request retransmission update

Enzo 1 ay önce
ebeveyn
işleme
b282c2cad4

+ 2 - 2
services/utility/prepareFISmessage.ts

@@ -14,7 +14,7 @@ export function prepareResponseMessages(amount: number, intervalBetweenMessages?
     let subscription: Subscription
 
     if (intervalBetweenMessages) {
-        console.log(`Generate data with intervals`)
+        // console.log(`Generate data with intervals`)
         subscription = interval(intervalBetweenMessages).subscribe({ // 10millisecond
             next: () => {
                 count++
@@ -29,7 +29,7 @@ export function prepareResponseMessages(amount: number, intervalBetweenMessages?
             }
         });
     } else {
-        console.log(`Generate data without intervals`)
+        // console.log(`Generate data without intervals`)
         for (let i = 0; i <= amount; i++) {
             if (i >= amount) {
                 returnSubject.complete()

+ 1 - 1
test/socket/socket-client.ts

@@ -9,7 +9,7 @@ import { ClientInfo } from "./socket.service";
 let onHoldMessagesSubject: Subject<WrappedMessage> = new Subject()
 let toBePassedOverToApp: Subject<BaseMessage> = new Subject()
 // Serve static files (optional)
-let sender: Subject<BaseMessage> = prepareResponseMessages(1, 2000)
+let sender: Subject<BaseMessage> = prepareResponseMessages(5, 2000)
 let serverSocketUrl: string = 'http://192.168.100.96:3000'
 let socket: Socket
 

+ 2 - 0
test/socket/socket-test-server.ts

@@ -34,12 +34,14 @@ function returnResponse(request: BaseMessage): Observable<BaseMessage> {
         prepareResponseMessages(10, 1000).subscribe({
             next: (message: BaseMessage) => {
                 message.header.messageID = request.header.messageID
+                console.log(`Generating response message for ${request.header.messageID}`)
                 observer.next(message)
             },
             error: err => console.error(err),
             complete: () => {
                 prepareResponseMessages(1, 1000).subscribe({
                     next: message => {
+                        console.log(`Finalizing complete response for request${request.header.messageID}`)
                         message.header.messageID = request.header.messageID
                         message.header.messageName = 'Complete'
                         observer.next(message)

+ 1 - 2
test/socket/socket.service.ts

@@ -76,7 +76,7 @@ export class SocketService {
                     // check if client exists
                     let clientObj = this.connectedClients.find(obj => obj.clientName === msg.data.clientName)
                     if (clientObj) {
-                        // clientInfo = clientObj
+                        clientInfo = clientObj
                         console.log('Existing client found')
                         // but also update socketId
                         clientObj.id = socket.id
@@ -88,7 +88,6 @@ export class SocketService {
                             updatedId: socket.id
                         })
 
-                        socket.emit('notification', `Hello from server. You have been assigned ${socket.id}`);
                         // resume operation Release them buffer
                         /* local client isOnline need not be mutated, since this is a new connection. However the previous intance of client Connection State
                         inside the retransmission needs to be updated to release the buffered values.*/