{"id":20577007,"url":"https://github.com/fourcube/ltcp","last_synced_at":"2026-04-22T04:02:45.569Z","repository":{"id":31291923,"uuid":"34853983","full_name":"fourcube/ltcp","owner":"fourcube","description":"Simple TCP Handlers in golang","archived":false,"fork":false,"pushed_at":"2015-05-01T12:57:24.000Z","size":140,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-06T11:22:58.446Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/fourcube.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}},"created_at":"2015-04-30T12:46:43.000Z","updated_at":"2017-12-20T18:46:27.000Z","dependencies_parsed_at":"2022-07-30T19:38:02.687Z","dependency_job_id":null,"html_url":"https://github.com/fourcube/ltcp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fourcube/ltcp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fourcube%2Fltcp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fourcube%2Fltcp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fourcube%2Fltcp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fourcube%2Fltcp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fourcube","download_url":"https://codeload.github.com/fourcube/ltcp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fourcube%2Fltcp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32120402,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-22T00:31:26.853Z","status":"online","status_checked_at":"2026-04-22T02:00:05.693Z","response_time":58,"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":[],"created_at":"2024-11-16T05:47:45.072Z","updated_at":"2026-04-22T04:02:45.549Z","avatar_url":"https://github.com/fourcube.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ltcp\n\n[![GoDoc](https://godoc.org/github.com/fourcube/ltcp?status.svg)](http://godoc.org/github.com/fourcube/ltcp) [![Build Status](https://travis-ci.org/fourcube/ltcp.svg?branch=master)](https://travis-ci.org/fourcube/ltcp)\n\nltcp is a simple library providing an easy way to spawn tcp handlers. It might be useful for your tests.\n\nHandlers are functions of type `func (net.Conn)`.\n\nSample code:\n\n```go\npackage main\n\nimport (\n\t\"github.com/fourcube/ltcp\"\n \t\"net\"\n)\n\nfunc main() {\n\t// Listens on some random, available port on all interfaces\n\t// handles all connections with the ltcp.EchoHandler\n\t//\n\t// You can send ltcp.Shutdown through the 'done' channel to stop the listener.\n\t//\n\tdone := make(chan struct{})\n\taddr, err :=\tltcp.ListenAny(ltcp.EchoHandler, done)\n\n\tconn, err := net.Dial(\"tcp\", addr.String())\n\tif err != nil {\n\t\t// ...\n\t}\n\n\t// ... do whatever with the connection\n\n\tconn.Close()\n\t// The listener will shutdown when it receives something on the done channel\n\t// It then closes the done channel\n\tdone \u003c- ltcp.Shutdown\n\t\u003c-done\n}\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffourcube%2Fltcp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffourcube%2Fltcp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffourcube%2Fltcp/lists"}