Hi Pablo, thanks for the reply. I thought the TCPSocket was for communicating to third-parties, while a channel is to communicate with a set of users connected to the APE server. For most users in a LAN setting, the TCPSocket implementation seems to be working fine. I don't encounter a disconnect, and my users do not send anything through the socket; they just receive. The disconnection usually occurs with people with slow connections.
Anyway as you suggested I tried reading up on the channels and looking at examples, but I'm confused. With this approach, are all my users suppose to connect to one channel (a non interactive one) and receive the updates from my server there? If that's the case how should I connect the channel to my server? If you can share how one would implement that approach or give some example I can study it would be greatly appreciated! Thanks again for taking the time to reply! On Thursday, August 9, 2012 6:24:54 PM UTC+8, Gino wrote: > > I have an application where my clients need to receive data from a server. > It's one way, the clients don't need to send data to the server. > I've used the TCPSocket implementation to have my clients connect to the > server directly. > I followed this example: > http://www.ape-project.org/wiki/index.php/TCPSocket > I edited the socket.onread() event to call a function that updates my page > with the latest data that is pushed to the client. > > Everything works fine but I notice how some clients suddenly stop, and it > seems like their connection is lost. I need to refresh the page for me to > reconnect and have things working back to normal. > I noticed the socket.onclose() doesn't seem to fire when this occurs. I > want to be able to somehow catch when the connection is lost and try to do > a re-connection. > > I did discover that error codes 004 and 250 were popping up in raw data > that was being passed. I tried using the client.onError event for 004 and > 250 but I don't know how to reset the socket. > socket.close() does nothing, and when i try to do a socket.open nothing > happens. > > What's the best way to capture disconnects and reestablish my connection > to ensure a smooth connection for my clients? > I'm also open to hear if there are better ways to implement this for my > use case. Would love to hear from the community. > > Thanks! > -- You received this message because you are subscribed to the Google Groups "APE Project" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/ape-project?hl=en --- APE Project (Ajax Push Engine) Official website : http://www.ape-project.org/ Git Hub : http://github.com/APE-Project/
