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

Warning when trying to subscribe a server to a multicast group #71

Open
gandalfitexpert opened this issue Jan 2, 2024 · 0 comments
Open

Comments

@gandalfitexpert
Copy link

gandalfitexpert commented Jan 2, 2024

Hello,

I am trying to bind a server to a multicast group, unfortunately, I get this warning :

PHP Warning: socket_set_option(): Unable to set socket option [92]: Protocol not available

I am using the copy/paste code from this documentation page :

https://openswoole.com/docs/modules/swoole-server-getSocket

namely, this line :

$ret = socket_set_option( $socket, IPPROTO_IP, MCAST_JOIN_GROUP, [ 'group' => '10.0.0.1', 'interface' => 'eth0' ] );
(assuming 10.0.0.1 is a muticast address)
I also tried using number '2' instead of IPPROTO_IP, unsuccessfully.

My environment is :
Windows 10
WSL 1
Ubuntu 22.04 LTS

BTW what about the port assignment, especially if you want a client to subscribe to the same group ?
Indeed a client would connect this way I guess :
$client->connect('10.0.0.1', 9905, 0.5)

So what about the port ? Do we care about it ?

Thanks for your help.

Regards

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

No branches or pull requests

1 participant