Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: support other protocol families #17

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

santigimeno
Copy link
Collaborator

I'm studying how to modify this module to support other protocol families apart from AF_UNIX while still using SOCK_DGRAM. I have 2 options: 1) copy most of the code from this module and replace the functionality related to AF_UNIX . 2) Try to make most of the code independent of the protocol family so any protocol family can easily be added.

Does this sound reasonable? Does trying #2 make any sense?

In this PR I've tried to accomplish this for bind, connect and sendto. I'm still trying to figure out a simple way to implement the reception. What do you think?

Thanks

s.sun_family = AF_UNIX;
assert(node::Buffer::HasInstance(buf));

s = reinterpret_cast<sockaddr*>(node::Buffer::Data(buf));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const sockaddr*?

@santigimeno
Copy link
Collaborator Author

@bnoordhuis done. Thanks for the review. Does this change make sense to you?

When I find a satisfactory way to handle the reception will come back here.

@bnoordhuis
Copy link
Owner

Does this change make sense to you?

If you're asking if I object to it, I don't. :-)

Apropos style, can you wrap long lines at 80 columns? Cheers.

@santigimeno
Copy link
Collaborator Author

If you're asking if I object to it, I don't. :-)

Yeah, that was my question :-). Thanks.

Apropos style, can you wrap long lines at 80 columns? Cheers.

Will do

@santigimeno
Copy link
Collaborator Author

Wrapped to 80 and rebased to master

@santigimeno
Copy link
Collaborator Author

@bnoordhuis Reception implementation.
In OnRecv I have initialized the whole sockaddr_storage to 0 as it was simpler than trying to make an implementation to initialize sockaddr_un

@santigimeno
Copy link
Collaborator Author

rebased to current master

@bnoordhuis
Copy link
Owner

Sorry, I've completely forgotten about this. I don't have much time to work on this module but if you want, I'll make you a collaborator.

@santigimeno
Copy link
Collaborator Author

@bnoordhuis Thanks for the offer. ATM I don't have time to work on this functionality but can help maintaining this module if you think you need some help.

@bnoordhuis
Copy link
Owner

More maintainers can't hurt. I'll add you to the repo. If you give me your npm handle, I'll give you publish rights as well.

@santigimeno
Copy link
Collaborator Author

npm handle: sgimeno
Thanks

@bnoordhuis
Copy link
Owner

Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants