views:

328

answers:

4

I want to make a very simple c++ instant messenger for lan networks and internet (direct IP connect). I know little about sockets. I searched the internet, but nothing really helped. I would someone to suggest a howto/tutorial/guide. I just want to send and receive messages (in a console window, I'll create the gui later). I want it to be for both Linux and Windows. Thanks in advance!

+3  A: 

check out Boost.ASIO

just somebody
duplicate of the above by space cowboy. his also provides a link.
Jason D
@Jason - this one isn't the duplicate - it came first
warren
It came first.. but now link no nothing :)
Lipis
+10  A: 

Checkout Boost.Asio. It's portable, and it's also got an example that implements a simple chat.

Space_C0wb0y
Thanks, I'll try that and post if I have any questions.
Levo
I cannot find where to download the libraries and the headers.
Levo
Download at http://www.boost.org/users/download/. You will have to do some reading to get this working though.
Space_C0wb0y
I get a linker error while trying to compile the example code in dev-c++: [Linker error] undefined reference to `_Unwind_Resume' Does anybody know how to fix it?
Levo
from my experience, examples (of any boost libraries i've tried) don't always compile. try a different example file. or which example it is. or something.
just somebody
It is the only chat client example. I tried linking many different libs, but nothing worked.
Levo
+3  A: 

Use boost, cross platform, under the link, straight forward example for client-server chat.

bua
+4  A: 

There's some source code here for a C/S chat application that you could probably use to get started.

Mas.

Example Code

MaSuGaNa
I tried that earlier, but there is a header file I couldn't find.
Levo
What header file?
MaSuGaNa
@MaSuGaNa - I was wrong, it was a similar project of the same author which used a header I couldn't find.Is this only for windows, or I misunderstood?
Levo
The code looks easy enough to modify for cross platform use. If you want something already written I'd go with Boost.
MaSuGaNa