{"id":19316060,"url":"https://github.com/socketry/socketry","last_synced_at":"2025-09-28T23:31:01.847Z","repository":{"id":54255304,"uuid":"62482123","full_name":"socketry/socketry","owner":"socketry","description":"High-level wrappers for Ruby sockets with advanced thread-safe timeout support","archived":false,"fork":false,"pushed_at":"2021-03-05T16:16:00.000Z","size":150,"stargazers_count":135,"open_issues_count":3,"forks_count":15,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-01-11T19:43:08.687Z","etag":null,"topics":["asyncio","ruby","sockets","timeouts"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","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/socketry.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-07-03T05:01:51.000Z","updated_at":"2024-09-20T19:15:29.000Z","dependencies_parsed_at":"2022-08-13T10:10:31.900Z","dependency_job_id":null,"html_url":"https://github.com/socketry/socketry","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/socketry%2Fsocketry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/socketry%2Fsocketry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/socketry%2Fsocketry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/socketry%2Fsocketry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/socketry","download_url":"https://codeload.github.com/socketry/socketry/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234570246,"owners_count":18854139,"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":["asyncio","ruby","sockets","timeouts"],"created_at":"2024-11-10T01:09:44.494Z","updated_at":"2025-09-28T23:31:01.387Z","avatar_url":"https://github.com/socketry.png","language":"Ruby","readme":"# ![Socketry](https://socketry.org/images/socketry.svg)\n\n[![Gem Version][gem-image]][gem-link] [![Build Status][build-image]][build-link] [![Code Climate][codeclimate-image]][codeclimate-link] [![Coverage Status][coverage-image]][coverage-link] [![MIT licensed][license-image]][license-link]\n\n[gem-image]: https://badge.fury.io/rb/socketry.svg\n[gem-link]: https://rubygems.org/gems/socketry\n[build-image]: https://secure.travis-ci.org/socketry/socketry.svg?branch=master\n[build-link]: https://travis-ci.org/socketry/socketry\n[codeclimate-image]: https://codeclimate.com/github/socketry/socketry.svg?branch=master\n[codeclimate-link]: https://codeclimate.com/github/socketry/socketry\n[coverage-image]: https://coveralls.io/repos/github/socketry/socketry/badge.svg?branch=master\n[coverage-link]: https://coveralls.io/github/socketry/socketry?branch=master\n[license-image]: https://img.shields.io/badge/license-MIT-blue.svg\n[license-link]: https://github.com/socketry/socketry/blob/master/LICENSE.txt\n\nHigh-level Ruby socket library with support for TCP, UDP, and SSL sockets.\n\nImplements thread-safe timeouts using asynchronous I/O and high-precision monotonic timers.\n\n## Motivation\n\nBy default, Ruby sockets do not provide a built-in timeout mechanism. The only\ntimeout mechanism provided by the language leverages [timeout.rb], which uses\n[unsafe multithreaded behaviors] to implement timeouts.\n\nWhile Socketry provides a synchronous, blocking API similar to Ruby's own\n`TCPSocket` and `UDPSocket` classes, behind the scenes it uses non-blocking I/O\nto implement thread-safe timeouts.\n\n[timeout.rb]: http://ruby-doc.org/stdlib-2.3.1/libdoc/timeout/rdoc/Timeout.html\n[unsafe multithreaded behaviors]: http://blog.headius.com/2008/02/ruby-threadraise-threadkill-timeoutrb.html\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem \"socketry\"\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install socketry\n\n## Basic Usage\n\nBelow is a basic example of how to use Socketry to make an HTTPS request:\n\n```ruby\nrequire \"socketry\"\n\nsocket = Socketry::SSL::Socket.connect(\"github.com\", 443)\nsocket.writepartial(\"GET / HTTP/1.0\\r\\nHost: github.com\\r\\n\\r\\n\")\np socket.readpartial(1024)\n```\n\n[TCP], [SSL], and [UDP] servers and sockets also available.\n\n[TCP]: https://github.com/socketry/socketry/wiki/TCP\n[SSL]: https://github.com/socketry/socketry/wiki/SSL\n[UDP]: https://github.com/socketry/socketry/wiki/UDP\n\n## Documentation\n\n[Please see the Socketry wiki](https://github.com/socketry/socketry/wiki)\nfor more detailed documentation and usage notes.\n\n[YARD API documentation](http://www.rubydoc.info/gems/socketry/)\nis also available.\n\n## Supported Ruby Versions\n\nThis library aims to support and is [tested against][travis] the following Ruby\nversions:\n\n* Ruby 2.2.6+\n* Ruby 2.3\n* Ruby 2.4\n* Ruby 2.5\n* JRuby 9.1.6.0+\n\nIf something doesn't work on one of these versions, it's a bug.\n\nThis library may inadvertently work (or seem to work) on other Ruby versions,\nhowever support will only be provided for the versions listed above.\n\nIf you would like this library to support another Ruby version or\nimplementation, you may volunteer to be a maintainer. Being a maintainer\nentails making sure all tests run and pass on that implementation. When\nsomething breaks on your implementation, you will be responsible for providing\npatches in a timely fashion. If critical issues for a particular implementation\nexist at the time of a major release, support for that Ruby version may be\ndropped.\n\n[travis]: http://travis-ci.org/socketry/socketry\n\n## Contributing\n\n* Fork this repository on github\n* Make your changes and send us a pull request\n* If we like them we'll merge them\n* If we've accepted a patch, feel free to ask for commit access\n\n## License\n\nCopyright (c) 2016 Tony Arcieri. Distributed under the MIT License. See\n[LICENSE.txt](https://github.com/socketry/socketry/blob/master/LICENSE.txt)\nfor further details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsocketry%2Fsocketry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsocketry%2Fsocketry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsocketry%2Fsocketry/lists"}