Hack Forums
[C#] Simple TCP Chat Client & Server - 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 TCP Chat Client & Server (/showthread.php?tid=5615072)



Simple TCP Chat Client & Server - passwords - May 4, 2017

Bunnies Simple TCP Client & Server (Heavily Commented)



So it's been a while since I realeased something and that's mainly because I have no idea what to release.
But recently I've been doing alot of networking and I got really into the TcpClient class provided in the .NET Framework for C#.
So here it is!
A simple TCP Client & Server that will help you grasp the concept of how to make a chat application.


Server Listening

[Image: uIwohJ9.png]

Server & Client Working Together

[Image: xHqe9ZP.png]




Enjoy & I hope you learn something! 🤝


Thanks to Finn for adding the credits, forgot to mention him in the code! 🤝

Quote:Finn. Wrote: ►
Saw the same code on stackoverflow, you just edited it a bit. Anyways thanks for sharing i guess.

http://stackoverflow.com/questions/10182...imple-text




* - Demauen - May 4, 2017

Ooooh nice I needed something like this, thanks man!


* - passwords - May 4, 2017

(May 4, 2017 09:46 AM)Demauen Wrote:  Ooooh nice I needed something like this, thanks man!

Anytime! I'm glad I could help! 🤝


* - HFDone - May 4, 2017

not multithreading just one connection ...


* - passwords - May 4, 2017

(May 4, 2017 10:15 AM)HFDone Wrote:  not multithreading just one connection ...

Did you even read the thread?

Quote:A simple TCP Client & Server that will help you grasp the concept of how to make a chat application.




* - ForceJew - May 4, 2017

Nice try multi threading it now:)


* - Finn. - May 4, 2017

Saw the same code on stackoverflow, you just edited it a bit. Anyways thanks for sharing i guess.

http://stackoverflow.com/questions/10182751/server-client-send-receive-simple-text


* - passwords - May 4, 2017

(May 4, 2017 11:26 AM)Finn. Wrote:  Saw the same code on stackoverflow, you just edited it a bit. Anyways thanks for sharing i guess.

http://stackoverflow.com/questions/10182751/server-client-send-receive-simple-text

Oh crap thanks!
Was support to add credits in the code but I forgot! I'll add you to the post 🤝


* - tcsh - May 4, 2017

(May 4, 2017 12:26 PM)VEN0M+ Wrote:  Oh crap thanks!
Was support to add credits in the code but I forgot! I'll add you to the post 🤝

Why would you add him? He just saw it, not write it. lol.

Nice try with the share though :-)


* - passwords - May 4, 2017

(May 4, 2017 12:38 PM)tcsh Wrote:  Why would you add him? He just saw it, not write it. lol.

Nice try with the share though :-)

No I wasnt going to add Finn to the code haha I was going to add the guy from stack. 😁


* - Finn. - May 4, 2017

(May 4, 2017 12:56 PM)VEN0M+ Wrote:  No I wasnt going to add Finn to the code haha I was going to add the guy from stack. 😁

Next time don't forget it^^


* - Ninja - May 5, 2017

This is a very basic example, and you forgot to dispose of a few things, but thanks for the release. You should try using asynchronous methods such as BeginAccept and things like that. And sending your own data structures and using your own protocol. Maybe even checksum validation to ensure file integrity.