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

Expose file descriptors of IO::Socket::INET instances #880

Merged
merged 1 commit into from Jul 2, 2018

Conversation

Kaiepi
Copy link
Contributor

@Kaiepi Kaiepi commented Jun 22, 2018

Before, .native-descriptor was available from IO::Socket, but always
returned -1.

Could be useful if people want to do stuff with sockets natively

@@ -434,19 +434,32 @@ MVMint64 socket_getport(MVMThreadContext *tc, MVMOSHandle *h) {
return port;
}

static MVMint64 socket_is_tty(MVMThreadContext *tc, MVMOSHandle *h) {
MVMIOSyncSocketData *data = (MVMIOSyncSocketData *)h->body.data;
return isatty(data->handle);
Copy link
Member

Choose a reason for hiding this comment

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

Would a socket ever be a TTY? I think this will break the Windows build; it'll need something like this doing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure if it's actually possible or not, but I added it just to be safe

Before, `.native-descriptor` was available from IO::Socket, but always
returned -1.
@jnthn jnthn merged commit 7547dd8 into MoarVM:master Jul 2, 2018
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.

None yet

2 participants