Robin
Robin

Reputation: 1342

Implementing a simple server / client concept in C++

I'm searching for a library / framework / codesnippet that helps me build a really simple server / client. Both should be portable (linux/win/mac).

A picture says more then a thousand words so: alt text

The server should be able to seperate diffrent clients. What I'm looking for is only a hint on how to do the transfere. I've little experience with languages other then c++, and it was mostly plain easy to create a server that stores all the clients connected in an array and interacts with each one of them once you got pointed in the right direction.

What I looked into for C++ was RakNet and Boost.Asio. I don't want to use RakNet because I might sell the application at some point (you never know) and Boost.Asio seems way to complex for me to understand and way to low-level. All I really need is a simple send/recieve functionallity. The json will be handled by me (I already looked into jsoncpp). One message will have a maximum length of 2048 bytes.

Any suggestions / hints / help on what to look into / what to use? I'm really looking for something easy and not so much low-level to use as I don't need the low-level functionallity.

Thanks in advance,
Robin.

Upvotes: 1

Views: 2829

Answers (3)

Raphael
Raphael

Reputation: 8192

As cross-platform and easy-to-use are both requirements I would recommend Qt. It's pretty easy, reliable and cross-platform.

http://qt.nokia.com/products/developer-tools/

It comes with lots of samples including 13 networking samples (take a look at the threaded server tutorial which I believe it's just what you're after).

Upvotes: 1

Jay
Jay

Reputation: 14441

I enjoyed Beej's guide to network programming.

Upvotes: 3

zhengtonic
zhengtonic

Reputation: 730

Have you done Network programming before? Its pretty straight forward in C. And what you want can be implemented in a few hours. I used this manual below to finish my assignments back when i was a student.

http://shoe.bocks.com/net/

Just read this and you are good to go. Its really not very hard.

Good Luck!

Upvotes: 3

Related Questions