C
C#10mo ago
Yung$moke

Synchronous Chat Program

I'm doing this assignment that's due tomorrow and i don't know what im doing. basically i need to make a C# program where I can connect client and server and be able to chat between the two. So when i send a message in client it goes to server and vice versa. any help would be appreciated. (this is what i have so far)---->
No description
No description
No description
4 Replies
friedice
friedice10mo ago
so what are you stuck on?
Yung$moke
Yung$mokeOP10mo ago
its like when i start the program it only connects to the client and nothing else. all honesty i dont think its even connected i just need some sort of hint or anything. i dont understand how to make the two send messages with each other is the main issue i suppose
lycian
lycian10mo ago
on the same machine, using a single tcpclient is easiest. There's not really any idea of "server" or "client", it's just read and write on the stream. if you're running two separate programs, then each basically is a "client", but may differ in how they respond
lycian
lycian10mo ago
Use TcpClient and TcpListener - .NET
Learn how to use the TcpClient class to create a socket to request and receive data using TCP in .NET.
Want results from more Discord servers?
Add your server