{"id":15039803,"url":"https://github.com/tallesl/net-socket","last_synced_at":"2025-07-11T12:41:31.611Z","repository":{"id":25698481,"uuid":"29134844","full_name":"tallesl/net-Socket","owner":"tallesl","description":"A minimalist wrapper around System.Net.Sockets.Socket.","archived":false,"fork":false,"pushed_at":"2017-03-06T15:15:44.000Z","size":35,"stargazers_count":20,"open_issues_count":0,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-10T00:05:40.752Z","etag":null,"topics":["csharp","dot-net","ipv4","network","nuget","socket","stream","tcp","wrapper"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tallesl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-01-12T12:39:37.000Z","updated_at":"2025-03-26T09:39:58.000Z","dependencies_parsed_at":"2022-08-23T10:31:15.049Z","dependency_job_id":null,"html_url":"https://github.com/tallesl/net-Socket","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tallesl%2Fnet-Socket","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tallesl%2Fnet-Socket/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tallesl%2Fnet-Socket/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tallesl%2Fnet-Socket/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tallesl","download_url":"https://codeload.github.com/tallesl/net-Socket/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248131319,"owners_count":21052819,"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","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","dot-net","ipv4","network","nuget","socket","stream","tcp","wrapper"],"created_at":"2024-09-24T20:43:51.230Z","updated_at":"2025-04-10T00:05:52.198Z","avatar_url":"https://github.com/tallesl.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003ca href=\"#socket\"\u003e\n        \u003cimg alt=\"logo\" src=\"Assets/logo.png\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n# Socket\n\n[![][build-img]][build]\n[![][nuget-img]][nuget]\n\nA minimalist wrapper around a .NET's [Stream]\u0026nbsp;[IPv4]\u0026nbsp;[TCP]\u0026nbsp;[Socket].\nEverything is synchronous.\n\n**Disclaimer**: I've used this library only on prototypes and small use cases, it never reached production. Even though the code is fairly small, consider that while using it.\n\n[build]:     https://ci.appveyor.com/project/TallesL/net-socket\n[build-img]: https://ci.appveyor.com/api/projects/status/github/tallesl/net-socket?svg=true\n[nuget]:     https://www.nuget.org/packages/Socket\n[nuget-img]: https://badge.fury.io/nu/Socket.svg\n[Stream]:    http://msdn.microsoft.com/library/System.Net.Sockets.AddressFamily\n[IPv4]:      http://msdn.microsoft.com/library/System.Net.Sockets.SocketType\n[TCP]:       http://msdn.microsoft.com/library/System.Net.Sockets.ProtocolType\n[Socket]:    http://msdn.microsoft.com/library/System.Net.Sockets.Socket\n\n## Usage\n\nAn stupid echo server:\n\n```cs\nusing (var listener = new SocketListener(1337)) // Start listening\n{\n    for (;;)\n    {\n        using (var remote = listener.Accept()) // Accepts a connection (blocks execution)\n        {\n            var data = remote.Receive(); // Receives data (blocks execution)\n            remote.Send(data); // Sends the received data back\n        }\n    }\n}\n```\n\nAnd its client:\n\n```cs\nusing (var socket = new ConnectedSocket(\"127.0.0.1\", 1337)) // Connects to 127.0.0.1 on port 1337\n{\n    socket.Send(\"Hello world!\"); // Sends some data\n    var data = socket.Receive(); // Receives some data back (blocks execution)\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftallesl%2Fnet-socket","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftallesl%2Fnet-socket","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftallesl%2Fnet-socket/lists"}