Skip to content

Commit 80e83c3

Browse files
Ensure there is an active Router on the Network before sending message
1 parent f99d14d commit 80e83c3

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

Client/src/App.vue

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,24 @@ export default {
139139
}
140140
}
141141
};
142+
if (!this.hasFirstRouter) {
143+
this.getInformationFromSwitcher();
144+
145+
return (
146+
this.logMessage(
147+
`Initial Router has not been detected on the Switcher Netowrk`
148+
),
149+
this.logMessage(`Requesting information from Switcher for Router 1`)
150+
);
151+
}
152+
// Send message
153+
// let sendMessage = Buffer.from("UDP CONNETION DATA");
154+
this.sendMessage(
155+
5,
156+
{ message, peer },
157+
this.routerIp,
158+
this.routerPort
159+
);
142160
143161
this.logMessage(
144162
`Sending message '${message}' to peer ${peer} through router ${router}.`

0 commit comments

Comments
 (0)