{"id":21585915,"url":"https://github.com/jas-bar/tram","last_synced_at":"2025-03-18T09:15:26.818Z","repository":{"id":76130090,"uuid":"81733329","full_name":"jas-bar/tram","owner":"jas-bar","description":null,"archived":false,"fork":false,"pushed_at":"2017-02-21T17:39:07.000Z","size":20,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-24T15:35:11.181Z","etag":null,"topics":["c-plus-plus","cmake","cpp","network","raii","socket"],"latest_commit_sha":null,"homepage":null,"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/jas-bar.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-02-12T14:51:09.000Z","updated_at":"2017-02-13T20:36:57.000Z","dependencies_parsed_at":"2023-07-03T06:45:55.870Z","dependency_job_id":null,"html_url":"https://github.com/jas-bar/tram","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jas-bar%2Ftram","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jas-bar%2Ftram/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jas-bar%2Ftram/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jas-bar%2Ftram/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jas-bar","download_url":"https://codeload.github.com/jas-bar/tram/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244189826,"owners_count":20412991,"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":["c-plus-plus","cmake","cpp","network","raii","socket"],"created_at":"2024-11-24T15:12:09.803Z","updated_at":"2025-03-18T09:15:26.797Z","avatar_url":"https://github.com/jas-bar.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"tram\n---------------\n![tram-travis-build](https://travis-ci.org/jas-bar/tram.svg?branch=master)\n\ntram is a C++ networking \u0026 sockets library.\nIt is developed and tested on Linux.\ntram's goal is to stay minimal in terms of dependencies, so it should be easy to port it to other platforms.\n\n# Features \u0026 Concepts\n\n- simple stream-like interface, but for sockets\n- RAII sockets management: creating socket = connecting, destroying socket = disconnecting\n\n## Getting Started\n\ntram uses familiar stream-like interface for sockets.\n\n## Connecting to server\n\n```cpp\n{\n  tram::Client client(\"127.0.0.1\", \"12334\");\n  std::string res;\n  client \u003e\u003e res;\n  std::cout \u003c\u003c res \u003c\u003c std::endl;\n\n  // client socket is closed if no other client objects are using it\n}\n```\n\n## Setting up server\n```cpp\n{\n  tram::Server server(\"12334\");\n  tram::Client conn = server.acc();\n\n  conn \u003c\u003c \"H\" \u003c\u003c \"A\" \u003c\u003c \"H\" \u003c\u003c \"a\";\n\n  // conn is closed\n  // server is closed\n}\n```\n\n# Using tram in your projects\nTram can install to `/usr/include` and `/usr/lib` directories. It also installs a `.pc` file to be usable with [pkgconfig](https://people.freedesktop.org/~dbn/pkg-config-guide.html#using) tool. It is, however, **not** required to use pkgconfig to link against tram.\n```\n$ git clone https://github.com/jas-bar/tram\n$ cd tram\n$ cmake .\n$ make\n$ sudo make install\n```\n\nTram should now be available to you via pkgconfig.\nIf you are using CMake to build your project, you add this snippet to your `CMakeLists.txt`:\n```\ninclude(FindPkgConfig)\npkg_search_module(TRAM REQUIRED tram)\n```\nAfter this, `${TRAM_LIBRARIES}` and `${TRAM_INCLUDE_DIRS}` variables are defined, which can be utilized with `target_link_libraries` and `include_directories` respectively.\nIf everything is setup right, use `#include \u003ctram/tram.hpp\u003e` in your sources and you're ready to start coding.\n\nFor more information about this process, see pull request #12.\n\n# Licensing\n\ntram is under MIT license. See LICENSE for more information\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjas-bar%2Ftram","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjas-bar%2Ftram","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjas-bar%2Ftram/lists"}