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

socket_create() should return a Socket not a stream #4036

Closed
kklem0 opened this issue Oct 22, 2014 · 7 comments
Closed

socket_create() should return a Socket not a stream #4036

kklem0 opened this issue Oct 22, 2014 · 7 comments

Comments

@kklem0
Copy link
Contributor

kklem0 commented Oct 22, 2014

<?php
$c = socket_create(AF_UNIX, SOCK_STREAM, 0);
echo get_resource_type($c);

// returns stream, expecting Socket
@MaideCa
Copy link
Contributor

MaideCa commented Oct 23, 2014

Doing a clean build now with a fix for this. Will send a pull fix in a bit.

@paulbiss
Copy link
Contributor

We have a fix for this up internally already. Sorry about the duplicated effort.

@paulbiss paulbiss self-assigned this Oct 23, 2014
@MaideCa
Copy link
Contributor

MaideCa commented Oct 23, 2014

I guess I'll take my two lines of code elsewhere! ;)

Glad it's getting fixed. 👍

@kklem0
Copy link
Contributor Author

kklem0 commented Nov 3, 2014

@paulbiss
Copy link
Contributor

paulbiss commented Nov 3, 2014

Yep. It hasn't landed yet because as it turns out the Socket class is used by some of our stream socket resources that should themselves report that they are streams. There are a bunch of test failures that didn't get mirrored onto the external diff. I should have an update for it this week to address that.

danbruce pushed a commit to danbruce/net_gearman that referenced this issue Oct 14, 2015
HHVM's implementation of socket_create returns a resource of type "stream"
instead of type "socket" causing \Net\Gearman\Connection::isConnected to
return false even when the connection is a valid resource.

See: facebook/hhvm#4036
danbruce pushed a commit to danbruce/net_gearman that referenced this issue Oct 14, 2015
HHVM's implementation of socket_create returns a resource of type "stream"
instead of type "socket" causing \Net\Gearman\Connection::isConnected to
return false even when the connection is a valid resource.

See: facebook/hhvm#4036
danbruce pushed a commit to danbruce/gearman that referenced this issue Nov 2, 2015
HHVM's implementation of socket_create returns a resource of type "stream"
instead of type "socket" causing \Net\Gearman\Connection::isConnected to
return false even when the connection is a valid resource.

See: facebook/hhvm#4036
danbruce pushed a commit to danbruce/gearman that referenced this issue Nov 2, 2015
HHVM's implementation of socket_create returns a resource of type "stream"
instead of type "socket" causing \Net\Gearman\Connection::isConnected to
return false even when the connection is a valid resource.

See: facebook/hhvm#4036
@Orvid
Copy link
Contributor

Orvid commented Apr 29, 2016

Well, this still exists, but a quick test is claiming that socket_create doesn't exist in PHP, which is odd:
https://3v4l.org/ZMVUk

@apeabody
Copy link
Contributor

@Orvid Socket support is optional in PHP, my assumption is that it was purposely NOT included (--enable-sockets) in 3v4l.org given the opportunity for abuse.

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

No branches or pull requests

5 participants