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

Allow to recv and send file descriptors when using EpollDomainSocketChan... #3345

Closed
wants to merge 1 commit into from

Conversation

normanmaurer
Copy link
Member

...nel.

Motiviation:

When using domain sockets on linux it is supported to recv and send file descriptors. This can be used to pass around for example sockets.

Modifications:

  • Add support for recv and send file descriptors when using EpollDomainSocketChannel.
  • Allow to obtain the file descriptor for an Epoll*Channel so it can be send via domain sockets.

Result:
recv and send of file descriptors is supported now.

@normanmaurer
Copy link
Member Author

@trustin please review

@normanmaurer normanmaurer added this to the 4.0.26.Final milestone Jan 21, 2015

descriptorMessage.msg_control = control;
descriptorMessage.msg_controllen = sizeof(control);
struct cmsghdr *cmsg = CMSG_FIRSTHDR(&descriptorMessage);
Copy link
Member

Choose a reason for hiding this comment

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

Gentle reminder on consistent asterisk position :-)

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

@trustin
Copy link
Member

trustin commented Jan 26, 2015

First pass done. Please ping me for another pass.

@normanmaurer
Copy link
Member Author

@trustin ping :)

…hannel.

Motiviation:

When using domain sockets on linux it is supported to recv and send file descriptors. This can be used to pass around for example sockets.

Modifications:
- Add support for recv and send file descriptors when using EpollDomainSocketChannel.
- Allow to obtain the file descriptor for an Epoll*Channel so it can be send via domain sockets.

Result:
recv and send of file descriptors is supported now.
}

if (res < 0) {
return -err;
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps we could merge the two ifs:

if (res <= 0) {
    return -err;
}

@normanmaurer
Copy link
Member Author

Cherry-picked into 4.0 (495fa6b), 4.1 (3030b4a) and master (cabecee)

@normanmaurer normanmaurer deleted the domain_socket_2 branch February 6, 2015 06:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants