开发者

C++ networking simple send and receive

开发者 https://www.devze.com 2022-12-25 04:36 出处:网络
I\'m trying to link 10 computers together, the program I would like to write would have one \'control开发者_Go百科\' computer. From what I\'ve looked up this computer would take all the packets sent o

I'm trying to link 10 computers together, the program I would like to write would have one 'control开发者_Go百科' 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.


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

In my opinion the unchallenged best guide to socket programming.


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?

0

精彩评论

暂无评论...
验证码 换一张
取 消