P2P Network: - Broadcasting Events to Peers and Client Implemented

This commit is contained in:
Luis Fernando Molina committed 2021-11-10 14:53:38 +01:00
1 parent b5cf565a5b
commit 57c586c28b
3 files changed
+2 -7

No files matched your search

@@ -547,11 +547,6 @@ exports.newNetworkModulesWebSocketsInterface = function newNetworkModulesWebSock
let networkClient = thisObject.networkClients[i]
if (networkClient.socket.id === callerIdToAVoid) { continue }
networkClient.socket.send(messageHeader.payload)
.catch(onError)
function onError() {
console.log('[ERROR] Web Sockets Interface -> broadcastToPeers -> Sending Message Failed.')
}
}
}
@@ -274,7 +274,7 @@ exports.newNetworkModulesWebSocketsNetworkClient = function newNetworkModulesWeb
function onMenssageFunction(response) {
try {
if (response.result === 'Ok') {
if (response.result === 'Ok' || response.result === 'Warning') {
resolve(response.data)
} else {
console.log('[ERROR] Web Sockets Network Client -> onMenssageFunction -> response.message = ' + response.message)
@@ -111,7 +111,7 @@ exports.newSocialTradingModulesPeerInterface = function newSocialTradingModulesP
if (NT.projects.network.globals.memory.maps.EVENTS.get(eventReceived.eventId) !== undefined) {
let response = {
result: 'Ok',
result: 'Warning',
message: 'Peer Interface Event Already Exists.'
}
return response