views:

108

answers:

2

I'm trying to link 10 computers together, the program I would like to write would have one 'control' computer. From what I've looked up this computer would take all the packets sent over the network and do a echo with them... right? The other computers would need to be able to send information (then echoed to the others) to the 'control' ... is there a easy! or simple way to do this? From what I've seen I want a non-blocking socket?

I have looked into sockets and such but for an amateur programmer like me, this seems like a daunting task :)

I'm kind-of looking for an easy class implication that has a send() and an event driven recv().

I'm not going to be sending that much information over the network.

+3  A: 

http://beej.us/guide/bgnet/

In my opinion the unchallenged best guide to socket programming.

Ronny
so there's no 'easy' way out? :P
Wallter
Using a library like http://qt.nokia.com/doc/4.6/qtcpsocket.html it would be easier. I don't know if you have the freedom to do so, or if you want to include a big framework like Qt just to have easy access to sockets. --- I would go for the no, to answer your question. :) - my wisdom is limited, maybe there is sleek library to do so.
Ronny
+1  A: 

Any communications over a network requires you to have some understanding of networking in general. Even an echo server will have to decide to block in a single thread or provide multiple threads up to a point. What protocol? What is the target space (traditional Internet, isolated LAN, etc)?

W. Richards Stevens wrote good books on the subject (UNIX-based). Beej is another good online resource.

If you are really looking for easy why not just use a scripting language such as Ruby or Python to do this?

ezpz
I have never coded in Python... i have used C++ and C# though.... I will look into it though thanks!
Wallter
If you know nothing about networking and nothing about Python, you will make better progress learning Python to do the networking.
ezpz