Add IPv4 socket support across backends and socket API - #62
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of PR is this? (check all applicable)
Description
Adds IPv4 socket support to
fibers.io.socketand updates the FFI, nixio, and posix fd backends to accept a common sockaddr token format for UNIX and INET sockets.Also tightens backend error handling by normalising nixio return signatures (
msg, errnovserrno, msg) and fixes nixio directory mode handling somkdir()permissions work reliably across builds.Changes
Export
AF_INETfromfd_backend.core(and backend modules)Add AF_INET support to
fd_backend/ffi.lua(sockaddr_in,inet_pton,htons, bind/connect support)Extend
fd_backend/nixio.lua:mkdir()permission handling using octal strings for nixio compatibilityExtend
fd_backend/posix.lua:EINPROGRESS/EALREADY/EAGAIN)Extend
fibers.io.socket::bind()/:listen()listen_inet()/connect_inet()convenience helpersSocket:bind_inet()/Socket:listen_inet()/Socket:connect_inet()AF_INETUpdate
tests/test_io-socket.lua:read_exact,write_all,close_ok)Related Issues, Tickets & Documents
N/A
Screenshots/Recordings
N/A (no UI changes)
Manual test
Manual test description
Ran
tests/test.lua.Added tests?
Extended
tests/test_io-socket.luawith both AF_UNIX and AF_INET tests. Confirmed successful client/server roundtrip on:127.0.0.1) with explicit client source bindAdded to documentation?
[optional] Are there any post-deployment tasks we need to perform?
None.