Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

C 

Simple Chat Server with client.

I wrote this program to get re-accustomed to c++ since I really haven't coded much in a while. Therefore this may need some optimization. My next project will be converting the client from console to GUI and I will release that too.
I tried to make comments on certain lines to help you guys understand what is going on. feel free to learn from this and criticize this work.


EDIT: I forgot to mention there is a bug in the chatloop that doesn't allow you to switch who you are sending your message to. If you guys cannot manage to handle this properly, I will update the code that fixes this.

Preview of code:
Spoiler (Click to View)


Download

https://github.com/HFaeiro/ChatServerAndClient
[Image: 5Iq5rDJ.gif]

winapi, and winsock programmer

Nice post my dude. I don't need this but its one of those projects you download and play with anyways.
(Mar 7, 2018 11:37 PM)Leroy Jethro Gibbs Wrote:  Nice post my dude. I don't need this but its one of those projects you download and play with anyways.

Haha glad you enjoyed it. Feel free to modify it to your liking.
[Image: 5Iq5rDJ.gif]

winapi, and winsock programmer

(Mar 8, 2018 08:36 AM)aeiro Wrote:  Haha glad you enjoyed it. Feel free to modify it to your liking.

Only time I've ever done this was with .NET. It semi worked. I used it for high school. It would log what you said to a text document and display it on all clients connected to it. It was shit. But it was a learning experience.
(Mar 8, 2018 10:05 AM)Leroy Jethro Gibbs Wrote:  Only time I've ever done this was with .NET. It semi worked. I used it for high school. It would log what you said to a text document and display it on all clients connected to it. It was shit. But it was a learning experience.

This one doesn't log any messages. the client tells the server who it wants to talk to then the server just forwards that message to the corresponding server.
[Image: 5Iq5rDJ.gif]

winapi, and winsock programmer

That's closer to C than C++.
Where is the OOP?
(Mar 9, 2018 03:19 PM)Hoodie+ Wrote:  That's closer to C than C++.
Where is the OOP?

I'm still in the process of learning. Currently learning templates right now.


If you could point me in a direction on how i could have used OOP here that would be great.
[Image: 5Iq5rDJ.gif]

winapi, and winsock programmer

Great contribution OP! thanks


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Java] by OneHalfApr 30, 2026 12:09 PM 7 479 Apr 30, 2026 12:09 PM
Last Post: APIBoy
[C] by gurlhackerclubAug 31, 2020 09:34 PM 0 188 Aug 31, 2020 09:34 PM
Last Post: gurlhackerclub
[C#] by passwordsMay 5, 2017 04:45 AM 11 545 May 5, 2017 04:45 AM
Last Post: Ninja