• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

tarantool / tarantool / 5877825047
88%

Build:
DEFAULT BRANCH: master
Ran 16 Aug 2023 10:57AM UTC
Jobs 1
Files 492
Run time 21s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

16 Aug 2023 10:48AM UTC coverage: 86.263% (+0.03%) from 86.234%
5877825047

push

github

locker
net.box: allow to create connect from fd

Closes #8928

@TarantoolBot document
Title: Document `from_fd` net.box module function

The function takes a file descriptor number (fd) as its first argument
and a table of connection options as its second, optional argument. It
creates and returns a new connection object.

The fd should point to a socket and be switched to the non-blocking
mode, but this isn't enforced. If the fd is invalid, the connection may
not work as expected.

The functions takes the same options as [`connect`][net-box-connect].

The function takes the ownership of the fd, i.e. the fd must not be used
or closed after this function successfully returns.

Example:

The code below connects to a Tarantool instance at port 3301 using
the [`socket`][socket] module, then wraps the socket fd in a `net.box`
connection object.

```Lua
local net = require('net.box')
local socket = require('socket')

-- Connect a socket then wrap it in a net.box connection object.
local s = socket.tcp_connect('localhost', 3301)
assert(s ~= nil)
local conn = net.from_fd(s:fd(), {fetch_schema = false})
s:detach()

conn:call('box.schema.user.info')
conn:close()
```

[net-box-connect]: https://www.tarantool.io/en/doc/latest/reference/reference_lua/net_box/#net-box-connect
[socket]: https://www.tarantool.io/en/doc/latest/reference/reference_lua/socket/

63746 of 115365 branches covered (55.26%)

30 of 30 new or added lines in 1 file covered. (100.0%)

95457 of 110658 relevant lines covered (86.26%)

3042305.89 hits per line

Jobs
ID Job ID Ran Files Coverage
1 5877825047.1 16 Aug 2023 10:57AM UTC 0
86.26
GitHub Action Run
Source Files on build 5877825047
Detailed source file information is not available for this build.
  • Back to Repo
  • ae441c99 on github
  • Prev Build on master (#5877403814)
  • Next Build on master (#5878414173)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc