Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public void onMessage(ByteBuffer bytes) {
} catch (Exception e) {
tikTokEventHandler.publish(tikTokLiveClient, new TikTokErrorEvent(e));
}
if (isNotClosing()) {
if (isOpen()) {
sendPing();
}
}
Expand All @@ -79,8 +79,7 @@ private void handleBinary(byte[] buffer) {
pushFrameBuilder.setPayloadType("ack");
pushFrameBuilder.setLogId(websocketPushFrame.getLogId());
pushFrameBuilder.setPayload(webcastResponse.getInternalExtBytes());
if (isNotClosing())
{
if (isOpen()) {
this.send(pushFrameBuilder.build().toByteArray());
}
}
Expand All @@ -90,7 +89,7 @@ private void handleBinary(byte[] buffer) {
@Override
public void onOpen(ServerHandshake serverHandshake) {
tikTokEventHandler.publish(tikTokLiveClient, new TikTokConnectedEvent());
if (isNotClosing()) {
if (isOpen()) {
sendPing();
}
}
Expand All @@ -104,7 +103,7 @@ public void onClose(int code, String reason, boolean remote) {
@Override
public void onError(Exception error) {
tikTokEventHandler.publish(tikTokLiveClient, new TikTokErrorEvent(error));
if (isNotClosing()) {
if (isOpen()) {
sendPing();
}
}
Expand All @@ -129,10 +128,6 @@ private WebcastResponse getWebResponseMessage(ByteString buffer) {
}
}

private boolean isNotClosing() {
return !isClosed() && !isClosing();
}

@Override
public void onMessage(String s) {
// System.err.println(s);
Expand Down