node-diameter / node-diameter

Diameter base protocol implementation for NodeJS
Other
34 stars 29 forks source link

Client: Using an open TCP connection for multiple simultaneous connections #36

Open sdkks opened 7 years ago

sdkks commented 7 years ago

I'm not sure if this is something that is technically possible (js newbie here), if I were to open a new socket and call multiple functions with this connection as argument, for each of them to send different requests simultaneously to same host, I will have Promise errors.

To be able to send requests without waiting for response also is a challenge for me. I'm trying to find a way to bombard an OCS with high amount of requests to see how it fares, it allows only one tcp connection per interface (Gx, Gy) peer.

Please close if this is technically wrong way of thinking.

rkovacevic commented 7 years ago

I just did some testing, and I also get some errors like these, when sending multiple requests in a row:

Error: write after end at writeAfterEnd (_stream_writable.js:193:12) at Socket.Writable.write (_stream_writable.js:244:5) at Socket.write (net.js:661:40) at Object.callback (/Users/robert/dev/node-diameter/lib/diameter-connection.js:60:45) at Socket. (/Users/robert/dev/node-diameter/examples/diameter-client-example.js:48:15) at emitOne (events.js:96:13) at Socket.emit (events.js:188:7) at Socket. (/Users/robert/dev/node-diameter/lib/diameter-connection.js:51:37) at emitOne (events.js:96:13) at Socket.emit (events.js:188:7) at readableAddChunk (_stream_readable.js:176:18) at Socket.Readable.push (_stream_readable.js:134:10) at TCP.onread (net.js:551:20)

I'm looking into it.