Open istrau2 opened 5 years ago
@istrau2 Thanks for posting, we'll take a look as soon as possible.
For help with questions about Sails, click here. If you’re interested in hiring @sailsbot and her minions in Austin, click here.
@mikermcneil @sgress454 Would be great if we could get an answer relatively quickly as this is a blocker for us. Thank alot.
@istrau2 Hey, I haven't tried this myself but in case this helps, here's the relevant source code: https://github.com/balderdashy/sails.io.js/blob/88b96ea019db4a03a1fb5fff0600dc7fd23f7862/sails.io.js#L635-L1045
Thanks for taking the time to put this together so coherently, much appreciated! 👍
@johnabrams7 Hi, thanks for response. Can you please expand a little bit on the source code that you linked to?
It looks like the source to the sails.io.js library...
@istrau2 looks like conceptually that usage should work. To diagnose what's going on, it'd be great if you would provide your version info for:
- sails
Thanks!
@rachaelshaw I solved this a while ago so I don't recall the exact solution. I am pretty sure the issue is that the sockets need to be connected in series.
Something like:
//connect socket one
socketOne.on('connect', function() {
//connect socket two
});
Otherwise the sails socket client gets confused.
@istrau2 thanks for sharing your solution!
Sails version: N/A Node version: N/A NPM version: N/A DB adapter name: N/A DB adapter version: N/A Operating system: Windows
This issue is related to the sails.io.js library. We are using it on the front end along with webpack to connect via ws. We've recently added a separate server that is also ws enabled. Now, we are trying to setup the front end socket client to connect to BOTH ws enabled servers:
What we tried: Using the documentation, here is the code we tried (dumbed down to convey the essence):
Basically, we are connecting to the two hosts and then immediately sending a connection on both sockets.
Expected result: Ideally, both sockets would connect to their respective hosts and then, after successful connection, send the messages (which the client is supposed to queue until it successfully connects).
Actual observed result: Instead, two problems occur:
url2
.Questions We have the following questions:
sails.io.js
client library to connect to multiple hosts?connect
method, how does one issue a request immediately once the socket is connected?Thanks in advance