{"id":22472532,"url":"https://github.com/ericbatlle/simpleunitytcp","last_synced_at":"2025-08-02T10:30:39.986Z","repository":{"id":124125219,"uuid":"160526971","full_name":"EricBatlle/SimpleUnityTCP","owner":"EricBatlle","description":"🖧 Simple Unity Project to show how TCP communication are builded in C# without multi-threading or Unity network (Unet) involved.","archived":false,"fork":false,"pushed_at":"2021-06-20T21:25:46.000Z","size":1162,"stargazers_count":57,"open_issues_count":0,"forks_count":11,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-07T15:03:59.696Z","etag":null,"topics":["csharp","networking","tcp","tcp-client","tcp-protocol","tcp-server","tcp-socket","tcpip","unity","unity-tutorial","unity3d"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EricBatlle.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-12-05T14:02:53.000Z","updated_at":"2025-05-14T07:33:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"bef54781-2e25-4d12-bf1d-6f782728b91b","html_url":"https://github.com/EricBatlle/SimpleUnityTCP","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/EricBatlle/SimpleUnityTCP","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EricBatlle%2FSimpleUnityTCP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EricBatlle%2FSimpleUnityTCP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EricBatlle%2FSimpleUnityTCP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EricBatlle%2FSimpleUnityTCP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EricBatlle","download_url":"https://codeload.github.com/EricBatlle/SimpleUnityTCP/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EricBatlle%2FSimpleUnityTCP/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268370673,"owners_count":24239777,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-02T02:00:12.353Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csharp","networking","tcp","tcp-client","tcp-protocol","tcp-server","tcp-socket","tcpip","unity","unity-tutorial","unity3d"],"created_at":"2024-12-06T12:16:04.409Z","updated_at":"2025-08-02T10:30:39.458Z","avatar_url":"https://github.com/EricBatlle.png","language":"C#","funding_links":["https://www.buymeacoffee.com/ebatlleclavero","https://github.com/sponsors/EricBatlle","https://paypal.me/EricBatlleClavero?locale.x=es_ES"],"categories":[],"sub_categories":[],"readme":"# SimpleUnityTCP 🖧 \n*Created by Eric Batlle Clavero*\n\n\nA simple **demo-project** to show how **TCP** communication works on **Unity** environment, builded with **C#** and using [System.Net.Sockets](https://docs.microsoft.com/es-es/dotnet/api/system.net.sockets?view=netframework-4.7.2). \n\nThe main porpouse of this repo is to show the TCP communication on runtime, but also to provide a pretty commented and clear code so everyone else that wants to implement that kind of communication will be able without wasting a lot of time.\n\n## Video-Example 📲\n\n\u003cp\u003e\n  \u003cimg src=\"example_app.gif\" alt=\"example_app gif\"/\u003e\n\u003c/p\u003e\n\n## Donations are appreciated! 💸\n*Remember that are many ways to say thank you.*\n\nIf this repository has been helpful remember to star it and consider buying me a coffee! 😀 \n\u003cp\u003e\n\u003ca href=\"https://www.buymeacoffee.com/ebatlleclavero\" target=\"_blank\"\u003e\u003cimg src=\"https://cdn.buymeacoffee.com/buttons/default-blue.png\" alt=\"Buy Me A Coffee\" width=\"144.6\" height=\"34\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\nIf you like my general work and contributions consider [sponsoring me on Github](https://github.com/sponsors/EricBatlle). \n\nBut if you just want to donate straightforward, I also have [PayPal.me](https://paypal.me/EricBatlleClavero?locale.x=es_ES).\n\n## How to Use 💻\nIf you only want to see the app working, just run the ``SimpleTCP.exe`` which is located on the ``build`` directory.\n\nIf you want to open the project, you will need to have **Unity** installed with the **version 2017 or higher**.\n\nIf you only want to scratch the code, either inside the unity project or simply dragging the **.cs** classes on your editor, you have to watch on to this classes, which are located on ``Assets\\Scripts``:\n\n* ``Server.cs``\n* ``Client.cs``\n\n## More Explanations 📡\n**Note:** Unity do not allow the *save-use* of **Multi-Threading**, so the application is using **Co-routines** instead.\n\nThe stablished communication and workflow stablished right now follows the next order:\n\n* **Start the Server** and let it waiting for client connections.\n* **Start the Client** and connect it to the server.\n* **Server/Client waits** for client/server messages...\n* **Client/Server sends** any type of message to the server/client.\n* **Server/Client sends** recives the message from the client/server.\n* **Server/Client waits** for new client/server messages...\n\n* **In Case Client sends \"Close\" to Server**\n* **Client sends \"Close\" to Server**, and waits a timeOut to disconnect from it.\n* **Server recives** that *Close* message and **closes the connection** with the client.\n* **Server** waits for new incoming client connections.\n\n* **Server shuts down** (Optional)\n\nKeep in mind that this \"Close\" system is not the typical four-way handshake used in TCP, but it's builded like this to keep it simple and understandable.\nYou can learn more about TCP Connection termination [here](https://en.wikipedia.org/wiki/Transmission_Control_Protocol#:~:text=The%20connection%20termination%20phase%20uses,end%20acknowledges%20with%20an%20ACK.).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericbatlle%2Fsimpleunitytcp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fericbatlle%2Fsimpleunitytcp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericbatlle%2Fsimpleunitytcp/lists"}