From dc06b46a89130e2a695ac839e2657ad2d6da9437 Mon Sep 17 00:00:00 2001 From: Lukas Holst Date: Wed, 21 Aug 2024 17:00:47 -0400 Subject: [PATCH] debug --- Modules/DTN/shared/src/main/scala/dtn/WSConnection.scala | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Modules/DTN/shared/src/main/scala/dtn/WSConnection.scala b/Modules/DTN/shared/src/main/scala/dtn/WSConnection.scala index f944bd980..9074a08f0 100644 --- a/Modules/DTN/shared/src/main/scala/dtn/WSConnection.scala +++ b/Modules/DTN/shared/src/main/scala/dtn/WSConnection.scala @@ -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 @@ -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] = {