Gntem
Gntem

Reputation: 7165

Browser sockets api?

i tried to use websockets for a small game in WebGL but was a total failure because of websockets/browser support being unstable.. do you know anything other than Flash sockets ,Ajax that can be used to create realtime in my game? firefox only pls.

Upvotes: 0

Views: 117

Answers (1)

Toji
Toji

Reputation: 34498

Well, you're kind of limiting your options there. Flash sockets is, frankly, probably the most stable option you have at this exact moment, and if stability is a greater concern for you than using the upcoming standards then the choice to use a plugin should be an easy one.

Still, I'm not entirely clear on what caused you to give up on Websockets. When you say "unstable" do you mean that the API has been changing (it has), that it has trouble staying connected, or that browser support is limited? (You did say Firefox only, so I can't imagine that would be an issue.)

The only other HTML5 solution that comes to mind is WebRTC, which will have a UDP-like persistant connection, but I'm not sure if any browsers have actually implemented that part of it yet. In the meantime while that API settles I would recommend looking at using Websockets via Socket.io, since they do a fairly good job of abstracting away some of the compatibility quirks (and can even fall back to Flash sockets if Websockets aren't available.)

Part of developing with cutting edge technologies is accepting the fact that they're often a moving target. It worth asking yourself very seriously: do I care more about standards or stability? At some point those will converge into the same thing, but we're not there yet.

Upvotes: 1

Related Questions