views:

155

answers:

5

Can anyone find an example of a simple server/client thing? I'm willing to use any C++ library or even Winsocks it self. I've Googled around but want some opinion on a good article for beginners/sites.

+1  A: 

JFGI

http://www.adp-gmbh.ch/win/misc/sockets.html
http://tldp.org/LDP/LG/issue74/tougher.html
caskey
+4  A: 

see http://beej.us/guide/bgnet/output/html/singlepage/bgnet.html

Jasmeet
+1 Best guide ever written imho.
ereOn
+4  A: 

If you are looking for a C++ networking library, I suggest Asio, which is now part of Boost. Start with the Tutorial. Also have a look at the examples.

Vijay Mathew
+6  A: 

If you're willing to use a C++ library, I heartily recommend Qt. It gives you an easy way to communicate with sockets, and much more. In particular see the QtNetwork module - a few of its relevant classes for your cause: QTcpSocket, QTcpServer, QUdpSocket.

Eli Bendersky
Qt is nice and will allow you to things quickly. But if he really wants to understand how things work, I believe it might more interesting for him to use the native socket directly.
ereOn
@ereOn: fair enough. My suggestion is with the assumption that he wants to write a real application. For learning, Beej's guide is a much better idea
Eli Bendersky
Thanks for the link, but I think the first one links to the wrong thing. I think this is also a good idea to start with a lib first then go deeper into the sockets, and some day, write my own.
kooo
@kooo: tx, fixed the link
Eli Bendersky
A: 

I like ACE. It is a pretty large library but there are some core classes that are really easy to use for beginning network programming.

Here's a really good book for ACE too. Ace Programming Guide

zooropa