Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
lh70 committed Aug 21, 2024
1 parent e82edde commit dc06b46
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Modules/DTN/shared/src/main/scala/dtn/WSConnection.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import sttp.ws.WebSocketFrame.{Binary, Ping, Pong, Text}
import java.nio.charset.StandardCharsets
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
import java.time.ZonedDateTime

class WSConnection(ws: WebSocket[Future]) {
val backend: GenericBackend[Future, WebSockets] = CompatCode.backend
Expand Down Expand Up @@ -107,7 +108,11 @@ class WSEndpointClient(host: String, port: Int, connection: WSConnection, val no
}

def sendBundle(bundle: Bundle): Future[Unit] = {
connection.sendBinary(Cbor.encode(bundle).toByteArray)
println(s"starting to send bundle at time: ${ZonedDateTime.now()}")
connection.sendBinary(Cbor.encode(bundle).toByteArray).map(u => {
println(s"sent bundle at time: ${ZonedDateTime.now()}")
u
})
}

def registerEndpointAndSubscribe(service: String): Future[WSEndpointClient] = {
Expand Down

0 comments on commit dc06b46

Please sign in to comment.