Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
lh70 committed Aug 9, 2024
1 parent 4cb845e commit 1af0b2b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 4 additions & 1 deletion Modules/DTN/jvm/src/main/scala/dtn/Monitoring.scala
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ class MonitoringServer(server: TCPReadonlyServer, paths: MonitoringPaths = Monit

val now: ZonedDateTime = ZonedDateTime.now(ZoneId.of("UTC"))

println(s"trying to decode data: ${String(data, StandardCharsets.UTF_8)}")

Json.decode(data).to[MonitoringMessage].value match
case m: MonitoringMessage.BundleReceivedAtRouter =>
streamReceived.write(Json.encode[MonitoringMessage](m.copy(time = Option(now))).toByteArray)
Expand All @@ -57,7 +59,8 @@ class MonitoringServer(server: TCPReadonlyServer, paths: MonitoringPaths = Monit
}
} catch {
case e: Exception =>
println(s"monitoring server ran into exception: $e")
println("monitoring server ran into exception:")
e.printStackTrace()
} finally {
server.stop()
}
Expand Down
2 changes: 0 additions & 2 deletions Modules/DTN/jvm/src/main/scala/dtn/TCPConnection.scala
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ class TCPConnection(socket: Socket) {

inputStream.readFully(bytes, 0, size)

println(String(bytes, StandardCharsets.UTF_8))

bytes
} catch {
case e: IOException => println(s"read attempted on closed socket: $e"); throw e
Expand Down

0 comments on commit 1af0b2b

Please sign in to comment.