Page 1 of 1

What are 'sockets' good for?

Posted: Wed Mar 19, 2003 5:30 pm
by Gen-ik
Sockets are one thing I haven't really learnt about but know from friends in the business that they are used a lot on 'virtual worlds' like Ibiza.com etc.

At the moment I am using Flash to call a PHP file every 10 seconds, and this PHP file sends the Flash movie all of the current variables (positions/actions/speach) etc of other people in the 'virtual world'.

But... will the use of Sockets make this any better or allow real-time updates?

Posted: Sun Mar 23, 2003 8:28 am
by Gen-ik
Sorry.. I'm keeping this topic alive because I haven't had any replies yet.

Posted: Sun Mar 23, 2003 9:15 am
by hedge
Sockets is a term thrown around that can refer to many things. To me it implies tcp/ip sockets which is just a pipe between processes.

I have attached a link to an example of some php code that uses a socket to connect to another website to pull some content.
viewtopic.php?t=7063

I am not an expert in this but I believe you would need to have a java applet embedded in your page that uses sockets to communicate to a servlet on the server in order to get real-time updates.

Posted: Sun Mar 23, 2003 9:47 am
by Gen-ik
Ok thanks for that.

I think I will just stick with the way I'm doing things at the moment.. it's not real-time but there's only a few seconds lag between someone moving in the virtual-world and the movements being updated on everyone elses screen so it's almost-real-time.

I'll check out that link away :)