public function send($msg)
{
if (!$this->WebSocket->closing) {
if (!$msg instanceof DataInterface) {
$msg = new Frame($msg);
}
$this->connection->send($msg->getContents());
}
return $this;
}