Java Communication

Hello!

I'm a Belgian programmer, and I'm looking for all informations about the way to communicate from a computer to another using Java.

In fact, I'm implementing a kind of on-line game using a GUI on each player's computer. This GUI sent to and receive from each other all informations they need to run the game.

So, that's a peer-to-peer network into each computer send data string to each other.

Notice that each players will know the IP of each others...

I'd thought to use UDP sockets, but that's just an idea...

I welcomed all the ideas and URl, such as tutorials.

Thanks,

allreader@hotmail.com

[663 byte] By [allreader] at [2007-9-27 16:49:13]
# 1

Depending on how many players your game will have, I would use a mixture of UDP and Sockets.

Since UDP is not transaction based, I would use that to inform other consoles that they are up and running. Basically each GUI would be transmitting Im alive on your UDP group/port every couple of seconds. Other simple messages are good on UDP.

Since Sockets are transaction based, I would use them for any ordered communication, i.e. status and information messages to and from the consoles. It might be easier if you made one person "host" a game and let their PC be the one that is the main driver. Everyone else will just be connecting up to the host console.

Definetally read up on the Network Communications tutorial, and take a look at the Bingo game walkthrough for a nice implementation of UDP.

http://java.sun.com/docs/books/tutorial/together/index.html

markkid at 2007-7-6 1:07:10 > top of Java-index,Other Topics,Java Game Development...