Skip to content

Commit 4e1ad53

Browse files
kriswestRoaders
authored andcommitted
Improve FDC3 for Web demo default settings for testing use
1 parent fb4ace6 commit 4e1ad53

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

toolbox/fdc3-for-web/demo/src/client/da/dummy-desktop-agent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ window.addEventListener('load', () => {
141141
},
142142
},
143143
];
144-
const fdc3Server = new DefaultFDC3Server(sc, directory, channelDetails, true, 20000, 10017);
144+
const fdc3Server = new DefaultFDC3Server(sc, directory, channelDetails, true, 20000, 15000);
145145

146146
socket.on(FDC3_APP_EVENT, (msg, from) => {
147147
fdc3Server.receive(msg, from);

toolbox/fdc3-for-web/demo/static/da/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@
4242
<p>Demo Desktop Agent</p>
4343

4444
<select name="opener" id="opener">
45-
<option value="Tab" default>New Tab</option>
46-
<option value="Frame">Frame</option>
45+
<option value="Frame" default>Frame</option>
46+
<option value="Tab">New Tab</option>
4747
</select>
4848

4949
<select name="approach" id="approach">

toolbox/fdc3-for-web/fdc3-web-impl/src/BasicFDC3Server.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export class DefaultFDC3Server extends BasicFDC3Server {
6868
userChannels: ChannelState[],
6969
heartbeats: boolean,
7070
intentTimeoutMs: number = 20000,
71-
openHandlerTimeoutMs: number = 10000
71+
openHandlerTimeoutMs: number = 15000
7272
) {
7373
const handlers: MessageHandler[] = [
7474
new BroadcastHandler(userChannels),
@@ -77,7 +77,7 @@ export class DefaultFDC3Server extends BasicFDC3Server {
7777
];
7878

7979
if (heartbeats) {
80-
handlers.push(new HeartbeatHandler(openHandlerTimeoutMs / 10, openHandlerTimeoutMs / 2, openHandlerTimeoutMs));
80+
handlers.push(new HeartbeatHandler(openHandlerTimeoutMs / 3, openHandlerTimeoutMs, openHandlerTimeoutMs * 3));
8181
}
8282

8383
super(handlers, sc);

toolbox/fdc3-for-web/fdc3-web-impl/src/handlers/HeartbeatHandler.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,11 @@ export class HeartbeatHandler implements MessageHandler {
3838
private readonly lastHeartbeats: Map<InstanceID, number> = new Map();
3939
private readonly timerFunction: NodeJS.Timeout;
4040

41-
constructor(pingInterval: number = 1000, disconnectedAfter: number = 5000, deadAfter: number = 20000) {
41+
constructor(pingInterval: number = 5000, disconnectedAfter: number = 30000, deadAfter: number = 60000) {
42+
console.log(
43+
`Setting up Heartbeat handler: pingInterval: ${pingInterval} ms, disconnectedAfter: ${disconnectedAfter} ms, deadAfter: ${deadAfter} ms`
44+
);
45+
4246
this.timerFunction = setInterval(() => {
4347
this.contexts.forEach(async sc => {
4448
const apps = await sc.getAllApps();

0 commit comments

Comments
 (0)