socket.io!


#21

Hi, tested and works great. Finally! Thanks man again.


#22

I need socket.io in my app. I’ve researched the forums and it looks like support is close but still not really easy?

Should I wait a month until Fuse fixes a few things or should I proceed to dig into it.

I’m concerned there still isn’t much documentation or an example on Github.


#23

@SkillsPlanet: if you take the library version that Igor fixed, it works no problem right now. The underlying Timer bug needs to be fixed, but it shouldn’t keep you away from using the altered version of socket.io lib.

As for examples and documentation, on Fuse side it’s about as simple as var sio = require("socket.io.js"); and then referring to socket.io docs for implementation details.


#24

SkillsPlanet wrote:

I need socket.io in my app. I’ve researched the forums and it looks like support is close but still not really easy?

Should I wait a month until Fuse fixes a few things or should I proceed to dig into it.

I’m concerned there still isn’t much documentation or an example on Github.

Hi there,
Workaround works fine. I can send ya my example which works out of the box, if that would help.

M.


#25

@solomun.marko would you mind making a github repo and linking that for everyone to see?


#26

Yep, sure. I will make that tonight and paste url here.


#27

Hi guys,

Here is App repo: https://github.com/markosole/Fuse-socket.io

Chears!


#28

I’ve used Socket.io before, but it’s been a while.

Does this modified file go on the client or the server?


#29

It goes on client side.


#30

I think I have it working, but for some reason the socket.io client keeps disconnecting then re-connecting, about every 23 - 57 seconds. This kinda breaks the whole chat I’m trying to write. Any idea why it’s doing this?

SERVER-SIDE:

18:42 DEV 9-30.3 (0.0.88) [67] connect ::ffff:73.53.168.153
19:20 DEV 9-30.3 (0.0.88) [67] disconnect
19:21 DEV 9-30.3 (0.0.88) [68] connect ::ffff:73.53.168.153
19:43 DEV 9-30.3 (0.0.88) [68] disconnect
19:45 DEV 9-30.3 (0.0.88) [69] connect ::ffff:73.53.168.153
20:32 DEV 9-30.3 (0.0.88) [69] disconnect
20:34 DEV 9-30.3 (0.0.88) [70] connect ::ffff:73.53.168.153
21:11 DEV 9-30.3 (0.0.88) [70] disconnect
21:12 DEV 9-30.3 (0.0.88) [71] connect ::ffff:73.53.168.153
21:35 DEV 9-30.3 (0.0.88) [71] disconnect
21:36 DEV 9-30.3 (0.0.88) [72] connect ::ffff:73.53.168.153
22:24 DEV 9-30.3 (0.0.88) [72] disconnect
22:26 DEV 9-30.3 (0.0.88) [73] connect ::ffff:73.53.168.153
23:02 DEV 9-30.3 (0.0.88) [73] disconnect
23:03 DEV 9-30.3 (0.0.88) [74] connect ::ffff:73.53.168.153
23:26 DEV 9-30.3 (0.0.88) [74] disconnect
23:28 DEV 9-30.3 (0.0.88) [75] connect ::ffff:73.53.168.153
24:16 DEV 9-30.3 (0.0.88) [75] disconnect
24:17 DEV 9-30.3 (0.0.88) [76] connect ::ffff:73.53.168.153
24:53 DEV 9-30.3 (0.0.88) [76] disconnect 

#31

Try to add timer (function to connect every second or 200ms) and check does it work. What can you see in your server log console? Firewall enabled or disabled?
It does happen that it disconnect sometimes but I am not really sure is it because of internet connection or something else.


#32

Still Googling and researching.

I’ve tried timers at various intervals. I think it helps a bit but not much. Still reconnects at least every 2 minutes.

I guess web sockets starts with a long-poll because it’s the most efficient. Does mobile even support long-polls and persistent web sockets?

BTW, do all the major popular chat apps for phones use web sockets? Or has something else come on the scene that’s better than web sockets for chat apps?


#33

Well, I am not sure. We should wait for javascript experts for reply. I am using sockets for the first time and it works for things I need. If it works from web, it should work from Fuse app too.