v0.1.4 sesame sockets

This commit is contained in:
2019-11-02 20:20:48 +01:00
parent 2828d1af67
commit 4087a12a87
8 changed files with 618 additions and 771 deletions
+21 -1
View File
@@ -50,4 +50,24 @@ RPCSocket.makeSocket<MyInterface>(20000, 'localhost').then((async (client) => {
})
await client.Group1.triggerCallbacks("Hello", "World", "Callbacks")
}))
}))
const srv = new RPCServer(30000, [{
name: 'Group2',
exportRPCs: () => [{
name: 'echo',
call: async (x) => x
}]
}], {
sesame: 'open'
})
const s = new RPCSocket(30000, 'localhost')
s.connect("open").then(async() => {
s['Group2']['echo']('open', 'dfgfg').then(console.log)
s['Group2']['echo']('dfgfg').then(console.log)
s['Group2']['echo']('dfgfg').then(console.log)
})