iqfareez / TCP-App

Simple demo for TCP Listener & TCP Client using Winforms C# .NET. For Software Engineering class Sem 2 22/23

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TCP Demo App (Server & Client)

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.

screenshot tcp demo server and clients

Getting Started

Clone the repository to your local machine and open the solution in Visual Studio/Rider.

Then, run both Server and Client app.

Localhost diagram

Connecting Client - Server in the same machine

Localhost diagram

The client and server are configured to connect to each other using the loopback address.

screenshot localhost setup

Note localhost can also be referenced by the loopback IP address 127.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.

Connecting Client - Server in different machines

Local network diagram

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.

wifi same network

From the TCP Server app, start the server. Notice there is an host:port information in the "On your network" section.

tcps erver app

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.

tcp client setting

Now, you can start sending messages between the client and server.

tcp client connected

Demo:

TCP.Server.Client.local.network.demo.mp4

Bonus: LED Demo

This is a bonus demo to show how the client can control the virtual 'LED' on the server.

led.tcp.demo.webm

Releases

See releases page.

Or, fork this repo and run the workflow Build C# WinForms app to build the artifacts.

Check this out

References

About

Simple demo for TCP Listener & TCP Client using Winforms C# .NET. For Software Engineering class Sem 2 22/23


Languages

Language:C# 100.0%