Websocket are sent only in when the connection is closed
I have the following code:

```
\Ratchet\Client\connect('ws://localhost:8090')->then(function($conn) {
	 
	
		$conn->on('close', function($code = null, $reason = null) {
            echo "Connection closed ({$code} - {$reason})\n";
        });
		
		$conn->send('Connected to WS');
			
		
		$ssh = new \phpseclib\Net\SSH2($deviceIP);
		$ssh->setTimeout(5);

		$result = $ssh->login('lab', 'lab');
		$conn->send('Logging in to device...');
		 $ssh->read();

		if (!$result) {
			exit('Login failed');
		}

		$ssh->write("en\n");
		$conn->send('Enabling device...');
		 $ssh->read();
		$ssh->write("pass\n");
		$ssh->setTimeout(5);
		echo $ssh->read();
		$conn->close();

});
```

The problem is that all the websockets are sent in the same time.

![image](https://user-images.githubusercontent.com/6171883/35345384-298fb802-0138-11e8-8420-7d9b7d2e5c08.png)


Why it happens? Is there any solution for this?