gatewayworker中,如何发送二进制数据给客户端?

0

workerman里,可以这样:
$connection->websocketType = Websocket::BINARY_TYPE_ARRAYBUFFER;


但gatewayworker里,Events::onMessage里,要怎么设置connection的websocketType呢?

已邀请:

walkor

赞同来自: 章鱼哥 edgexie

在start_gateway.php中设置


$gateway->onConnect = function($connection) {
$connection->websocketType = Workerman\Protocols\Websocket::BINARY_TYPE_ARRAYBUFFER;
};

要回复问题请先登录注册