Skip to content

nkudry/TCPClientServer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Dockerized TCP Python server and .NET(C#) client

Requirements

  1. Docker & Docker Compose - to run using Docker
  2. Visual Studio 2022 and Python 3 - to run locally

Run using Docker

  1. Clone / Download this repository.

  2. Open Terminal / Command Prompt at the project's root directory and type:

    docker-compose build --no-cache
    

    Project's root directory is the folder that contains the docker-compose.yaml, README.md, .gitignore files and TCPClient and TCPServer folders.

    • Running Server and Client in separate terminals with real-time outputs and input:

      Starting Server

      Use previously opened Terminal / Command Prompt and type:

      docker compose up tcp-server --no-build
      

      Starting Client

      Open another Terminal / Command Prompt at the project's root directory and type:

      docker-compose run --rm tcp-client
      
    • Running Client in single terminal with real-time output and input:

      Use previously opened Terminal / Command Prompt and type:

      docker compose up tcp-server --detach --no-build
      docker-compose run --rm tcp-client
      

Useful commands

  • Clone repository:
git clone https://github.com/nkudry/TCPClientServer.git
  • Attaching to an existing running container:
docker attach TCPClient
docker attach TCPServer
  • View container logs:
docker logs -f TCPServer
docker logs -f TCPClient
  • Clean up the docker compose images and containers:
docker compose down --rmi all

Run using Visual Studio & Python 3

  1. Clone / Download this repository.
  2. Open Terminal / Command Prompt at TCPServer directory and type:
python server.py

The server will start on port :54321

  1. Open TCPClient.csproj at TCPClient directory with Visual Studio 2022 and press Start (F5).

About

Simple Dockerized TCP Python server and .NET(C#) client

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published