Skip to content

Commit

Permalink
Revert accidental changes in ServerConnector.scala
Browse files Browse the repository at this point in the history
  • Loading branch information
ddworak committed Aug 28, 2023
1 parent 894cfdf commit 283b501
Showing 1 changed file with 6 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import io.udash.wrappers.atmosphere._
import org.scalajs.dom

import scala.scalajs.js
import scala.scalajs.js.JSON
import scala.util.control.NonFatal

trait ServerConnector {
Expand Down Expand Up @@ -43,36 +42,19 @@ abstract class AtmosphereServerConnector(
if (websocketSupport)
createRequestObject(
Transport.WEBSOCKET, reconnectInterval,
onOpen = (_: AtmosphereResponse) => {
println("onopen")
ready(ConnectionStatus.Open)
},
onReopen = (_: AtmosphereResponse) => {
println("onereopen")
ready(ConnectionStatus.Open)
},
onOpen = (_: AtmosphereResponse) => ready(ConnectionStatus.Open),
onReopen = (_: AtmosphereResponse) => ready(ConnectionStatus.Open),
onReconnect = (_: AtmosphereRequest, _: AtmosphereResponse) => {
println("onreconnect")
if (onReconnectTimeoutHandler != 0) dom.window.clearTimeout(onReconnectTimeoutHandler)
ready(ConnectionStatus.Closed)
onReconnectTimeoutHandler = dom.window.setTimeout(() => {
ready(ConnectionStatus.Open)
onReconnectTimeoutHandler = 0
}, reconnectInterval * 2)
},
onError = (_: AtmosphereResponse) => {
println("onerror")
ready(ConnectionStatus.Closed)
},
onClose = (r: AtmosphereResponse) => {
JSON.stringify(r)
println("onclose " + JSON.stringify(r))
ready(ConnectionStatus.Closed)
},
onClientTimeout = (_: AtmosphereResponse) => {
println("onclienttimeout")
ready(ConnectionStatus.Closed)
}
onError = (_: AtmosphereResponse) => ready(ConnectionStatus.Closed),
onClose = (_: AtmosphereResponse) => ready(ConnectionStatus.Closed),
onClientTimeout = (_: AtmosphereResponse) => ready(ConnectionStatus.Closed)
)
else {
isReady = ConnectionStatus.Open
Expand Down Expand Up @@ -132,7 +114,7 @@ abstract class AtmosphereServerConnector(
AtmosphereRequest(
url = serverUrl,
contentType = "application/json",
logLevel = "debug",
logLevel = "info",
transport = transport,
fallbackTransport = transport,
enableProtocol = true,
Expand Down

0 comments on commit 283b501

Please sign in to comment.