This is a simple TCP demo application consisting of a server and a client, developed using C# .NET WinForms. The solution contains two projects: TCP-Client and TCP-Server. The server and client communicate with each other over a TCP/IP connection, allowing them to exchange messages.
Clone the repository to your local machine and open the solution in Visual Studio/Rider.
Then, run both Server and Client app.
The client and server are configured to connect to each other using the loopback address.
Note
localhost
can also be referenced by the loopback IP address127.0.0.1
. This IP is fixed.
In TCP Server app, click Start Server
button to start the server. In TCP Client app, click Connect
button to connect to the server.
Now, you can start sending messages between the client and server.
In this section, I will be using Android since I don't have extra laptop to test this out. Feel free to use any other TCP Client on any devices.
Download TCP Client app from the Google Play Store.
Please ensure that both devices are connected to the same network.
From the TCP Server app, start the server. Notice there is an host:port information in the "On your network" section.
Note Your PC local IP address can also be found by running
ipconfig
in the command prompt.
On your Android device, open the TCP Client app and enter the host and port information from the server app.
Now, you can start sending messages between the client and server.
Demo:
TCP.Server.Client.local.network.demo.mp4
This is a bonus demo to show how the client can control the virtual 'LED' on the server.
led.tcp.demo.webm
See releases page.
Or, fork this repo and run the workflow Build C# WinForms app
to build the artifacts.
- CLI version of TCP Server and Client https://github.com/iqfareez/MCTE-4327-Software-Engineering/tree/main/ConsoleApp2-TCP
- For Software Engineering notes, go to https://github.com/iqfareez/MCTE-4327-Software-Engineering/
- Chat App C# Project from previous semester student https://github.com/zulhafiz-zulkifli/Chat-Application (their chat UI is beautiful)
- TCP Listener
- TCP Client
- ChatGPT