My issue is similar to #18 and #21
I have a react-native app and I connect to my development server like so:
let options = {
endpoint: 'ws://<server address>:3000/websocket',
SocketConstructor: ws,
reconnectInterval: 5000,
autoConnect: false,
autoReconnect: false,
maxTimeout: 3000
};
export const server = new simpleddp(options, [simpleDDPLogin]);
import { server } from 'some file'
connectToServer = () => {
server
.connect()
.then(() => {
console.log('server connected'); //never gets called
})
.catch(er => console.log('connection error', er)); //never gets called
}
If the Meteor server is running, everything works. If I stop the server, and attempt to load the App, the console.log() statements never get called.
I also tied the following:
connectToServer = async () => {
console.log('connect to server next');
try {
await server.connect()
console.log('CONNECTED?', server.connected); //never gets called
} catch (error) {
console.log('connection error: ', error); //never gets called
}
};
// some place else
connectToServer();
None of the server.on('error', ...) events are called as well.
How can I check if the server is available and connected?
Thanks.
My issue is similar to #18 and #21
I have a
react-nativeapp and I connect to my development server like so:If the
Meteor serveris running, everything works. If I stop the server, and attempt to load the App, theconsole.log()statements never get called.I also tied the following:
None of the
server.on('error', ...)events are called as well.How can I check if the server is available and connected?
Thanks.