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

Post message from a standalone php file #38

Open
GoogleCodeExporter opened this issue Jul 17, 2015 · 1 comment
Open

Post message from a standalone php file #38

GoogleCodeExporter opened this issue Jul 17, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

I have the following php file:

<?php
    $sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
    socket_connect($sock, '127.0.0.1', 12345);

    $msg = 'hi';
    $len = strlen($msg);

    socket_sendto($sock, $msg, $len, 0, '127.0.0.1', 12345);
    socket_close($sock);
?>

I set the up and it works, but I want to send a message from the above PHP file 
to the server, can this be done? When I do, I get the following error: 

PHP Warning:  socket_select(): 5 is not a valid Socket resource in 
/Desktop/phpwebsocket-read-only/server.php on line 18

Can somebody help? Thanks

Original issue reported on code.google.com by mich...@online-bouwmaterialen.nl on 1 Sep 2011 at 1:14

@GoogleCodeExporter
Copy link
Author

The server expects an opening handshake. Basically you need to make a PHP 
WebSocket client.

Below the specifications you will need:

http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol-76#page-7

I did make one myself, but rewrote the server as well to use the latest draft. 
You can download that one but its not compatible with phpwebsocket.  

The latest specification for reference: 
http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-13

Original comment by ch...@devristo.com on 1 Sep 2011 at 5:40

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

1 participant