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

Changed accept() in IO::Socket::INET so it returns the connected Socket. #40

Closed
wants to merge 3 commits into from
Closed

Conversation

supernovus
Copy link
Contributor

Changed discussed with jnthn in #perl6

@supernovus
Copy link
Contributor Author

Just making a note, that while this fixes a major issue, it doesn't fix it all the way. The $.family, $.proto and $.type are not set on the newly created object, as I'm not sure how to pass them during construction while using nqp::create(). Without those parameters, the socket settings may not match that of the parent socket, and "bad things" may occur.

@moritz
Copy link
Member

moritz commented Sep 13, 2011

You can use something along these lines:

 my $new := $?CLASS.bless(*, :$!family, :$!proto, ...);
 # and now nqp::bindattr on $new

which is just a wee bit evil.

Or maybe we need another constructor that doesn't initialize, or a named parameter to the existing one that prevents initialization, or something along these lines.

@supernovus
Copy link
Contributor Author

Okay, so I implemented the above, so that $!family, $!proto and $!type are passed through. It occurred to me later, that it makes no difference other than being able to query $connection.family, etc. as the parrot Socket object that we are binding to the new Perl 6 socket object, already has its internal settings set. Anyway, I'll commit a change with the new construction.

@moritz
Copy link
Member

moritz commented Sep 14, 2011

Thanks for the updated patch, I've squashed to two together and committed as f2857b7

@moritz moritz closed this Sep 14, 2011
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