()
| 2 | import { serviceProto, ServiceType } from './proto/serviceProto'; |
| 3 | |
| 4 | async function main() { |
| 5 | setInterval(() => { |
| 6 | for (let i = 0; i < 100; ++i) { |
| 7 | let client = new TSRPCClient<ServiceType>({ |
| 8 | server: 'ws://127.0.0.1:3000', |
| 9 | proto: serviceProto |
| 10 | }); |
| 11 | |
| 12 | client.connect().then(() => { |
| 13 | client.callApi('a/b/c/Test1', { name: '小明同学' }).then(v => { |
| 14 | // console.log('成功', v) |
| 15 | }).catch(e => { |
| 16 | console.error('错误', e.message) |
| 17 | }).then(() => { |
| 18 | client.disconnect(); |
| 19 | }); |
| 20 | }).catch(e => { |
| 21 | console.error('连接错误', e) |
| 22 | }) |
| 23 | } |
| 24 | }, 1000) |
| 25 | } |
| 26 | |
| 27 | main(); |
no test coverage detected