![]() |
|
[C] Simple Chat Server with client. - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [C] Simple Chat Server with client. (/showthread.php?tid=5808906) |
Simple Chat Server with client. - aeiro - Mar 7, 2018 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 RE: Simple Chat Server with client. - Leroy Jethro Gibbs - Mar 7, 2018 Nice post my dude. I don't need this but its one of those projects you download and play with anyways. RE: Simple Chat Server with client. - aeiro - Mar 8, 2018 (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. RE: Simple Chat Server with client. - Leroy Jethro Gibbs - Mar 8, 2018 (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. RE: Simple Chat Server with client. - aeiro - Mar 8, 2018 (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. RE: Simple Chat Server with client. - Hoodie+ - Mar 9, 2018 That's closer to C than C++. Where is the OOP? RE: Simple Chat Server with client. - aeiro - Mar 9, 2018 (Mar 9, 2018 03:19 PM)Hoodie+ Wrote: That's closer to C than C++. 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. RE: Simple Chat Server with client. - inyourmemory - Mar 14, 2018 Great contribution OP! thanks |