Skip to content

Commit

Permalink
Update WebSocket.hx
Browse files Browse the repository at this point in the history
  • Loading branch information
Onek8 authored Aug 13, 2024
1 parent 5db2d7e commit 97feaf2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Sources/armory/network/WebSocket.hx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class WebSocket {
_onmessage = value;
_ws.onmessage = function(message: Dynamic) {
if (_onmessage != null) {
if (Std.isOfType(message.data, JsBuffer)) {
if (message.data is JsBuffer) {
var buffer = new Buffer();
buffer.writeBytes(Bytes.ofData(message.data));
_onmessage(BytesMessage(buffer));
Expand Down Expand Up @@ -141,10 +141,10 @@ class WebSocket {
}

public function send(msg:Any) {
if (Std.isOfType(msg, Bytes)) {
if (msg is Bytes) {
var bytes = cast(msg, Bytes);
_ws.send(bytes.getData());
} else if (Std.isOfType(msg, Buffer)) {
} else if (msg is Buffer) {
var buffer = cast(msg, Buffer);
_ws.send(buffer.readAllAvailableBytes().getData());
} else {
Expand Down

0 comments on commit 97feaf2

Please sign in to comment.