Meteorjs with android client

#1

Hi all

I’m trying to implement java client side in order to connect meteor server whice use sockjs-node

**on android side i’m connection to the server with **AutobahnAndroid through a service , my questions:

  1. as part of sockJs-node api i can configure the heartbeat_delay, when connetion to server with js client i can see the heartbeat msg but when connecting with AutobahnAndroid i cant see it, which take me to the next question:

  2. my server go to “sleep” after some time with no connection unfortunately pen socket doesnt count as connection so after a while my android app stop getting msgs from the server and AutobahnAndroid does not call onClose so i cant be alerted when to do a reconnect (this is why i need the heartbeat )

thanks!

0 Likes

#2

Hi all

I'm trying to implement java client side in order to connect meteor
server whice use sockjs-node <https://github.com/sockjs/sockjs-node>
*on android side i'm connection to the server with
*AutobahnAndroid through a service , my questions:

1. as part of sockJs-node api i can configure the heartbeat_delay, when
connetion to server with js client i can see the heartbeat msg but
when connecting with AutobahnAndroid i cant see it, which take me to
the next question:

What heartbeats? Do you mean WebSocket pings? AutobahnAndroid answers WebSocket pings automatically with pongs, but does not expose an API for those. Neither for sending nor for receiving ..

2. my server go to "sleep" after some time with
no connection unfortunately pen socket doesnt count as connection so
after a while my android app stop getting msgs from the server and
AutobahnAndroid does not call onClose so i cant be alerted when to do a
reconnect (this is why i need the heartbeat )

Sorry, I don't understand the question.

However, I've added 2 issues which I think are relevant in this context:

https://github.com/tavendo/AutobahnAndroid/issues/31
https://github.com/tavendo/AutobahnAndroid/issues/32

- Tobias

···

Am 23.03.2013 14:35, schrieb elidor ben-simon:

thanks!

--
You received this message because you are subscribed to the Google
Groups "Autobahn" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to autobahnws+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

0 Likes

#3

Hi all

I’m trying to implement java client side in order to connect meteor
server whice use sockjs-node <https://github.com/sockjs/sockjs-node>
*on android side i’m connection to the server with
*AutobahnAndroid through a service , my questions:

  1. as part of sockJs-node api i can configure the heartbeat_delay, when
    connetion to server with js client i can see the heartbeat msg but
    when connecting with AutobahnAndroid i cant see it, which take me to
    the next question:

What heartbeats? Do you mean WebSocket pings? AutobahnAndroid answers
WebSocket pings automatically with pongs, but does not expose an API for
those. Neither for sending nor for receiving …

this is my configuration for the socket js server:

server = sockjs.createServer({

prefix: ‘/sockjs’, log: function(severity, message){

console.log(“message”,message)},

// this is the default, but we code it explicitly because we depend

// on it in stream_client:HEARTBEAT_TIMEOUT

heartbeat_delay: 25000,

// The default disconnect_delay is 5 seconds, but if the server ends up CPU

// bound for that much time, SockJS might not notice that the user has

// reconnected because the timer (of disconnect_delay ms) can fire before

// SockJS processes the new connection. Eventually we’ll fix this by not

// combining CPU-heavy processing with SockJS termination (eg a proxy which

// converts to Unix sockets) but for now, raise the delay.

disconnect_delay: 60 * 1000,

jsessionid: false});

you can see that I’m loggin each msg that sent or received by the server (including the heartbeats ),

so if the client is Js client I can see the heartbeat in the logs but when connecting with AutobahnAndroid i can only see the first request (the handshake) and nothing more…

am I missing somthing?

···

On Saturday, March 23, 2013 5:32:38 PM UTC+2, Tobias Oberstein wrote:

Am 23.03.2013 14:35, schrieb elidor ben-simon:

  1. my server go to “sleep” after some time with
    no connection unfortunately pen socket doesnt count as connection so
    after a while my android app stop getting msgs from the server and
    AutobahnAndroid does not call onClose so i cant be alerted when to do a
    reconnect (this is why i need the heartbeat )

Sorry, I don’t understand the question.

However, I’ve added 2 issues which I think are relevant in this context:

https://github.com/tavendo/AutobahnAndroid/issues/31
https://github.com/tavendo/AutobahnAndroid/issues/32

  • Tobias

thanks!


You received this message because you are subscribed to the Google
Groups “Autobahn” group.
To unsubscribe from this group and stop receiving emails from it, send
an email to autobahnws+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

0 Likes

#4

so if the client is Js client I can see the heartbeat in the logs but
when connecting with AutobahnAndroid i can only see the first request
(the handshake) and nothing more...
am I missing somthing?

AutobahnAndroid implements WebSocket (and WAMP). It'll talk to a WebSocket server. Does that server speak WebSocket?

Can you provide the log from Android when you run your app?

0 Likes

#5

so I have mange to solve most of the problems with server ,I still have one issue i cant figure out

I have implemented heartbeat on the open socket to the server and if i don’t get answer after X seconders i call wsClient.disconnect() and i have implemented onClose callback, the problem is that disconnect() try to send close MSG on the open socket while their is a case where one can change the phone from WiFi to GPRS and
AutobahnAndroid wont trigger onClose while the heartbeat will trigger disconnect() and which in turn wont do a thing because effectively the socket is disconnected,

can you suggest a solution?
thanks!

···

On Sunday, March 24, 2013 7:47:13 PM UTC+2, Tobias Oberstein wrote:

so if the client is Js client I can see the heartbeat in the logs but

when connecting with AutobahnAndroid i can only see the first request

(the handshake) and nothing more…

am I missing somthing?

AutobahnAndroid implements WebSocket (and WAMP). It’ll talk to a
WebSocket server. Does that server speak WebSocket?

Can you provide the log from Android when you run your app?

0 Likes