SKPHP1989 / phpws

Automatically exported from code.google.com/p/phpws
0 stars 0 forks source link

cannot create a client test websocket #23

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. create client_demo.php
2. add these code:
<?php
        require_once("websocket.client.php");

        $input = "Hello World!";
        $msg = WebSocketMessage::create($input);

        $client = new WebSocket("ws://127.0.0.1:12345/echo/");
        $client->sendMessage($msg);

        // Wait for an incoming message
        $msg = $client->readMessage();

        $client->close();

        echo $msg->getData(); // Prints "Hello World!" when using the demo.php server
?>
3. What is the expected output? What do you see instead?
Expect: echo $msg->getData();
Instead: Call to a member function sendMessage() on a non-object in D:\Dreamlad 
Projects\PHPSocket\phpws-1.0RC\websocket.client.php\
I also cannot do client test with client.html

What version of the product are you using? On what operating system?
Version: phpws-1.0RC
OS: Windows 7

Please provide any additional information below.
I run demo.php and started succeed websocket server. I need to run a client 
test with it. how can i do this?

Original issue reported on code.google.com by thanhv...@gmail.com on 17 Apr 2012 at 9:56

GoogleCodeExporter commented 8 years ago
Think you need to call $client->open(); I am aware that this is not well 
documented :(

Original comment by ch...@devristo.com on 18 Apr 2012 at 6:06

GoogleCodeExporter commented 8 years ago

Original comment by ch...@devristo.com on 21 May 2012 at 6:23